3

我从事 jQuery Mobile 的项目。

在页面中,我想mobilescroll用于选择(http://demo.mobiscroll.com/select#language=fr&display=inline

我尝试data-role="none",但它不适用于孩子并mobilescroll创建自己的标签。

如何在 a 的全部内容中禁用 jQuery Mobile 的样式div

谢谢

4

1 回答 1

1

It's possible to prevent jQuery Mobile from enhancing elements. however, following this solution will make your application slower than usual.

Demo

First, you need to globally set ignoreContentEnabled to true.

<head>
  <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
  <script>          
    $(document).on("mobileinit", function(){
      $.mobile.ignoreContentEnabled = true;
    });
  </script>
  <script src="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js"></script>
</head>

And then, add data-enhance="false" attribute to elements which you don't want JQM to enhance. This is the reason why app becomes slow, because JQM checks for this attribute in all elements.

于 2013-08-16T22:16:23.200 回答