Hi,
I have a couple of buttons that when clicked, they change between themes "a" and "b", I'm using this script to change themes:
- <script>
- $(document).ready(function() {
- $("#blueThemeButton").click(function() {
- $('[data-role=page]').page({theme:'a'});
- });
- $("#greenThemeButton").click(function() {
- $('[data-role=page]').page({theme:'b'});
- });
- });
- </script>
This works as expected when change from theme "a" to theme "b", but it doesn't work if theme "b" is applied and I want to change back to theme "a".
Looks like I can only move forward in the themes list, I tried removing the previous theme before applying the new one by adding this line before applying the themes:
- $("body").removeClass();
I also tried:
- $("#page").removeClass();
The first line doesn't have any effect and the second one removes everything from the page, it just leaves an empty blank page.
How can I remove the current theme before applying another? Is this the correct way to do it?
Thanks!