如何在jQuery移动页面之前修改它';有子弹吗?
我在jQuery Mobile 1.4.0中有一个单页应用程序,有4页。在开始时,我希望默认情况下禁用一些chckbox 这项工作:如何在jQuery移动页面之前修改它';有子弹吗?,jquery,jquery-mobile,Jquery,Jquery Mobile,我在jQuery Mobile 1.4.0中有一个单页应用程序,有4页。在开始时,我希望默认情况下禁用一些chckbox 这项工作: $("#page3 .ui-checkbox").prop("disabled", true); $("#page3 .ui-checkbox").addClass("ui-disabled"); html 要禁用/启用复选框或收音机,请使用.checkboxradio()函数。您不需要添加ui-state-disabled $(document)
$("#page3 .ui-checkbox").prop("disabled", true);
$("#page3 .ui-checkbox").addClass("ui-disabled");
html
要禁用/启用复选框或收音机,请使用
.checkboxradio()
函数。您不需要添加ui-state-disabled
$(document).on("pagecreate", "#pageID", function () {
$(".selector").checkboxradio("disable");
$(".selector").checkboxradio("enable");
});
要禁用/启用复选框或收音机,请使用
.checkboxradio()
函数。您不需要添加ui-state-disabled
$(document).on("pagecreate", "#pageID", function () {
$(".selector").checkboxradio("disable");
$(".selector").checkboxradio("enable");
});
使用
$(document).bind('pageinit')
而不是$(document).ready()
我不能。它会弄乱其他代码。。。pageinit=pagecreate我猜?您不需要在$(function(){})中包装pagecreate
或任何页面事件代码>@Omar将其移到了外面。。测试:)@omarsweet,works:)使用$(文档).bind('pageinit')
而不是$(文档).ready()
我不能。它会弄乱其他代码。。。pageinit=pagecreate我猜?您不需要在$(function(){})中包装pagecreate
或任何页面事件代码>@Omar将其移到了外面。。测试:)@Omar Sweet,works:)不知道你可以有多个页面创建:)现在我知道了!谢谢@BakedInhalf您可以将pagecreate
绑定到特定页面。不知道您可以有多个pagecreate:)现在我可以了!谢谢@BakedInhalf您可以将pagecreate
绑定到特定页面。
$(document).on("pagecreate", "#pageID", function () {
$(".selector").checkboxradio("disable");
$(".selector").checkboxradio("enable");
});