First of all, I apologize for my bad English. I'm trying to dynamically change the page theme with the function found in the jQuery mobile API documentation.
The function is like this:
$('[data-role="page"]').page( 'option', 'theme', 'b' );
If I run this function several times with different swatch themes, it adds the page CSS class theme for each swatch instead of switching it.
Example:
- I load the page with default theme.
It adds in the page class:
ui-page-theme-a
Then I execute:
$('[data-role="page"]).page( 'option', 'theme', 'b' );
It adds:
ui-page-theme-b
And removes:
ui-page-theme-a
Then I execute:
$('[data-role="page"]).page( 'option', 'theme', 'a' );
It adds:
ui-page-theme-a
But does not remove:
ui-page-theme-b
I don't know if this is the normal behavior (or happen only in my case) so I ask for clarification on this and in case this is the normal use, how to "emulate" a switch behavior? ( JQuery mobile 1.4.5)
Thanks.