Home >Web Front-end >JS Tutorial >jQuery's method of skinning a page_jquery
The example in this article describes how to skin the page with jQuery. Share it with everyone for your reference. The specific analysis is as follows:
Many students have done the effect of changing the skin of the page. Today when browsing the blog, I also found a piece of code using jQuery to change the skin. I posted it to share with you:
$(document).ready(function(){ $('#styleSwitch .button').bind('click', function(){ $('body').removeClass(); //remove all the other classes $('#styleSwitch .button').removeClass('selected'); $(this).addClass('selected'); switch(this.id){ case 'style1': $('body').addClass('style1'); break; case 'style2': $('body').addClass('style2'); break; case 'style3': $('body').addClass('style3'); break; } return false; }); });
I hope this article will be helpful to everyone’s jQuery programming.