2

Maybe there is something obvious I cannot see but I think that setting data-theme in the div with data-role=page was supposed to set it for everything:

<!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>

But I still get the default theme A

What am I doing wrong? Or is this a bug? It was working in 1 alpha 4 but not in 1 final.

6
  • works fine on jsFiddle, what exactly are you expecting to see?
    – Leon
    Dec 2, 2011 at 11:58
  • No, it does not. Theme B has a blue bar, not black bar jquerymobile.com/demos/1.0/docs/api/themes.html Dec 2, 2011 at 12:05
  • it does if you add data-theme="b" to the header itself (as mentioned in the JQM docs you linked) - do you actually mean the cascading styles are not working??
    – Leon
    Dec 2, 2011 at 12:07
  • I mean that setting the theme in the data-role="page" should cascade to the header. In versions before beta2 was working like that. Maybe a regression bug? Dec 2, 2011 at 12:11
  • you are right, there actually is a ticket about this which is still open...
    – Leon
    Dec 2, 2011 at 12:20

2 Answers 2

6

Check the docs, http://jquerymobile.com/demos/1.0/docs/pages/pages-themes.html it specifically says: "However, headers and footers will default to theme "a". If you want to have a page with, for example, only theme "b" for all its elements, including its header and footer, you will need to specify data-theme="b" to the page div as well as the header and footer divs. "

So this is not a bug.

2

The answer is that it's currently a bug and there's a ticket open about this

Just moved this from the comments for the OP to be able to mark as answer!

Thanks

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.