![](/img/trans.png)
[英]How to dynamically change data-theme of page element in jQuery Mobile
[英]how to make a theme switcher using the jQuery mobile's data-theme attribute
你看过jquery ui theme roller吗?它也适用于Jquery Mobile
http://jquerymobile.com/themeroller/
生成一组主题并相应地切换它。 这是关于切换的链接: http : //midnightprogrammer.net/post/Change-Page-Themes-Dynamically-Using-JQuery-Theme-Roller.aspx
您可以将data-theme =“THEME_LETTER”设置为php变量。 然后,在页面上有链接切换主题。 当用户单击主题“b”的链接时,它将设置会话变量,然后在每个页面加载时,将由php设置THEME_LETTER以反映其选择。
在HTML中,它看起来像这样:
data-theme =“ <?php echo $_SESSION['THEME_LETTER']; ?>
”
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.