您好,我有这个移动应用程序。我使用 jquery 隐藏功能来隐藏一些输入框。好吧,至少这是它应该做的,但我只是喜欢让它们变得非常小,就像线条一样,如果你理解我的代码在这里,你可以在我包含的 Jsfiddle 中看到我的意思提前谢谢
$(document).ready(function(){
$("#facebook").hide();
$("#twitter").hide();
$("#google").hide();
$("#MyName").hide();
$("#country").hide();
$("#social").click(function(){
if ($("#social").prop('checked') === true){
$("#facebook").show();
$("#twitter").show();
$("#google").show();
$("#MyName").show();
$("#country").show();
}
else
{
$("#facebook").hide();
$("#twitter").hide();
$("#google").hide();
$("#MyName").hide();
$("#country").hide();
}
});
});
最佳答案
工作 fiddle
http://jsfiddle.net/3Lcchxvv/4/
$(document).ready(function () {
$("#facebook").hide();
$("#twitter").hide();
$("#google").hide();
$("#MyName").hide();
$("#country").hide();
$(".ui-body-inherit").hide();//added
$("#social").click(function () {
if ($("#social").prop('checked') === true) {
$("#facebook").show();
$("#twitter").show();
$("#google").show();
$("#MyName").show();
$("#country").show();
$(".ui-body-inherit").show();//added
} else {
$("#facebook").hide();
$("#twitter").hide();
$("#google").hide();
$("#MyName").hide();
$("#country").hide();
$(".ui-body-inherit").hide();//added
}
});
});
关于Jquery Mobile 不会隐藏元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26752353/