2014-01-07 90 views
1

我刚刚将我的项目升级到JQM 1.4,并且它看起来像标题忽略了data-role =“none”属性(如果用在标题中的标记上)。这在JQM 1.3.2中有效。jQuery Mobile 1.4标题问题

请参考下面

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> 

回答

1

的的jsfiddle和代码这是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

+0

@Casey欢迎您:) – Omar