我有一个使用json填充的select项,但是jquery移动select没有显示默认的选定值。我已经阅读了文档,他们说需要设置以下内容:
$.mobile.selectmenu.prototype.options.hidePlaceholderMenuItems = false;但我真的不知道该怎么做
发布于 2013-02-03 05:11:59
在初始化jQuery移动端之前,需要在mobileinit事件中进行设置,如下所示:
<head>
<title>jQM Complex Demo</title>
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0"/>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css" />
<script>
$(document).on("mobileinit", function () {
$.mobile.selectmenu.prototype.options.hidePlaceholderMenuItems = true;
});
</script>
<script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script>
</head>https://stackoverflow.com/questions/14665457
复制相似问题