2011-12-02 53 views
2

也许有一些明显我不能看到,但我认为,在数据的作用格设置数据主题=页面应该设置它的一切:数据主题设置为页面不会应用到页眉和页脚jquerymobile

<!DOCTYPE html> 
<html> 
    <head> 
    <title>Page Title</title> 

    <meta name="viewport" content="width=device-width, initial-scale=1"> 

    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.css" /> 
    <script type="text/javascript" src="http://code.jquery.com/jquery-1.6.4.min.js"></script> 
    <script type="text/javascript" src="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.js"></script> 
</head> 
<body> 

<div data-role="page" data-theme="b"> 

    <div data-role="header"> 
     <h1>Page Title</h1> 
    </div><!-- /header --> 

    <div data-role="content"> 
     <p>Page content goes here.</p>  
    </div><!-- /content --> 

    <div data-role="footer"> 
     <h4>Page Footer</h4> 
    </div><!-- /footer --> 
</div><!-- /page --> 

</body> 
</html> 

但我仍然得到默认的主题A

我在做什么错?或者这是一个错误? 它在1 alpha 4中工作,但不在1 final中。

+0

在[jsFiddle](http://jsfiddle.net/YLF9b/)上正常工作,您期望看到什么? – Leon

+0

不,它没有。主题B有蓝条,没有黑条http://jquerymobile.com/demos/1.0/docs/api/themes.html – CodeClimber

+0

它,如果你将数据添加主题=“B”的标题本身(如提及您链接的JQM文档) - 您是否意味着级联样式不起作用? – Leon

回答

6

检查文档,http://jquerymobile.com/demos/1.0/docs/pages/pages-themes.html 它特别说:“但是,页眉和页脚将默认主题为‘B‘’如果你想有一个页面,例如,唯一的主题。’对于它的所有元素,包括页眉和页脚,您需要为页面div以及页眉和页脚div指定data-theme =“b”。“

所以这不是一个错误。

2

答案是,这是目前的一个错误,有一个ticket open about this

从注释刚搬进这对于OP能够标记为答案!

感谢