【问题标题】:on click of radio button display images using jquery Mobile单击单选按钮使用 jquery Mobile 显示图像
【发布时间】:2015-11-29 07:59:57
【问题描述】:

在一个页面中,我显示了一个类别的所有图像。

  $("input[name$='pets']").click(function() {
        var test = $(this).val();

        $("div.desc").hide();
        $("#flowers" + test).show();
    });
	});		
    
<label>
<input type="radio" name="pets"  value="2"  id="radio-choice-0a">Pets
</label>
<label>
<input type="radio"  name="flowers" value="3"  id="radio-choice-0b">Flowers
</label>

这是我的选择。单击宠物选项时,宠物图像将显示。否则禁用

【问题讨论】:

  • 欢迎来到 SO,这不是 Stackoverflow 的工作方式,您需要展示到目前为止您已经尝试过的内容,检查此以更好地理解它stackoverflow.com/help/how-to-ask
  • 到底是什么问题?
  • 我已经尝试并修复了它。谢谢
  • 酷发布答案并关闭此问题:)

标签: jquery jquery-mobile jquery-mobile-listview google-web-designer


【解决方案1】:

$("input[name$='pets']").click(function() { var test = $(this).val();

    $("div.desc").hide();
    $("#flowers" + test).show();
});
}); 

 $("input[name$='pets']").click(function() {
        var test = $(this).val();

        $("div.desc").hide();
        $("#flowers" + test).show();
    });
	});	

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-04-28
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多