Created
May 7, 2013 09:18
-
-
Save qborreda/5531352 to your computer and use it in GitHub Desktop.
CSS + jQuery Style Switcher
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link type="text/css" href="estilo1.css" rel="Stylesheet" id="linkestilo"> | |
<a href="estilo2.css" class="enlaceestilo">Cambia el estilo!</a><br> | |
<a href="estilo3.css" class="enlaceestilo">Cambia a otro estilo!</a><br> | |
<a href="estilo1.css" class="enlaceestilo">Volver al estilo original</a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(".enlaceestilo").click(function(e){ | |
e.preventDefault(); | |
var rutaEstilo = $(this).attr("href") | |
$("#linkestilo").attr("href", rutaEstilo) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment