CSS Style Switcher


/ Published in: jQuery
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <!-- HTML -->
  2. <a href="#" class="styleswitch" rel="dark.css">Dark</a>
  3. <a href="#" class=" styleswitch " rel="light.css">Light</a>
  4.  
  5. //JavaScript
  6. <script type="text/javascript">
  7. $(".styleswitch").click(function() {
  8. $('link[rel=stylesheet]').attr('href' , $(this).attr('rel'));
  9. });
  10. </script>

URL: http://sixrevisions.com/javascript/10-easy-jquery-tricks-for-designers/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.