Is it possible to have 3-4 CSS on a page, and then on any event, say click, change the css for entire webpage. This way we can give our user the ability to change the theme. I know we can change the css of an element by:
$("#myElementID").removeClass("class1").addClass("class2");
Yes, it is possible. Typically what you would do is write a JavaScript function that will change, or add, or remove a style sheet from the
<head>of the document. To make the experience a little better you’ll typically store the user’s preference in a cookie. There’s an article on A List Apart that show how to implement this.And of course, you can do this with jQuery… you may want to check out the source of jStyler.