Im using the addClass function with jQuery Mobile. I can see in the code that the class is added but its style that should be applied to it is ignored.
If I add the class to the html and refresh the page then the class is styled. So it seems to me that it might be something to with how JQM renders the page.
$('.slider1').click(function(){
$('.sliders').addClass('.slidersPosTwo');
});
Check-out the documentation for
.addClass(): http://api.jquery.com/addClass/Notice how the examples omit the period (
.) at the beginning of the class name. If you leave the period then it will be added as part of the class name, which should only be used as a selector.Your code will work if you make this change: