jquery-archive / jquery-mobile

jQuery Mobile Framework
https://jquerymobile.com
Other
9.68k stars 2.4k forks source link

JQuery mobile unable to change themes #8592

Open cesar-ioc opened 7 years ago

cesar-ioc commented 7 years ago

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.

Here is a sample: http://plnkr.co/edit/Xa1yhopCTUYHZAlI7M0q?p=preview