With jQuery Mobile I can create a page using a custom theme
<div data-role="page" data-theme="s" id="home">...
Now this works, but requires that I add this line in each of my pages and every-time I add a new page. I tried adding data-theme="s" to the body tag but this has no affect. Is there any way to do this other then setting it manually per page?
You would have to do it programmatically, AFAIK.
Something along the lines of:
Now, since there is no centralized hook – you will have to do the similar line for all theme options there are:
and so on.
I don’t have a list of all of them, but a quick look through the jquery.mobile-1.0rc1.js searching for
.prototype.options.reveals these:so it seems to me that you can go with these and discover more as you go. Note that not all of them are created like that – some are constructed dynamically in the code. Look for
Themestring to see what I mean.Update
$.mobile.page.prototype.options.themeshould be updated as well – based on Moak’s comment below.