【问题标题】:jQuery Mobile 1.4 header issuejQuery Mobile 1.4 标头问题
【发布时间】:2014-01-07 17:29:59
【问题描述】:

我刚刚将我的项目升级到 JQM 1.4,如果在标头中的标记上使用,标头似乎忽略了 data-role="none" 属性。这在 JQM 1.3.2 中有效。

请看下面的jsfiddle和代码

http://jsfiddle.net/caseylmanus/VL4HX/21/

<div data-role="page" id="p1">
<div data-role="header" data-theme='b'>
    <a href="#p1" data-role="none"><img src="http://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Back.svg/120px-Back.svg.png" style="height:15px"/></a>
     <h1>Header</h1>
</div>
<div data-role="content" data-theme='a'>
    Some content here
</div>
<div data-role="footer" data-position='fixed'>
     <h4>Footer</h4>

</div>

【问题讨论】:

    标签: jquery-mobile


    【解决方案1】:

    这是 jQuery Mobile 1.4 中的 bug,将在 1.4.1 中修复。

    要在官方修复发布之前修复此问题,请执行以下操作。

    mobileinit 上,将.keepNative 选项设置为任何自定义类。即.native。将此类添加到您不希望 jQM 增强的任何元素。

    <script src="jquery-1.10.2.min.js"></script>
    <script>
      $(document).on("mobileinit", function() {
        $.mobile.keepNative = ".native";
      });
    </script>
    <script src="jquery.mobile-1.4.0.js"></script>
    

    HTML

    <div data-role="header" data-theme='b'>
      <a href="#p1" class="native">
       <img src="120px-Back.svg.png" style="height:15px"/>
      </a>
      <h1>Header</h1>
    </div>
    

    Demo

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-07-31
      • 2012-05-31
      • 2014-03-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多