/ Published in: HTML

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<html> <head> <!-- Enlazamos el Framework de jQuery--> <!-- En el HTML debemos indicar en el enlace class="selector_estilo" y rel="estilo1" y en el rel del a estilo 2, etc... como el nombre del title del CSS correspondiente. Y el enlace de CSS debe contener el title que sea igual que el rel del enlace y además del rel="stylesheet", debemos indicar "alternate de la siguiente forma <link rel="stylesheet alternate".... --> <script type="text/javascript"> //<![CDATA[ $(document).ready(function(){ $.estiloInicial('estilo1'); $('.selector_estilo').bind('click', function() { $.estableceEstilo(this.getAttribute('rel')); return false; }); }); //]]> </script> <link rel="stylesheet" type="text/css" href="css/estilo1.css" title="estilo1" /> <link rel="stylesheet alternate" type="text/css" href="css/estilo2.css" title="estilo2" /> <link rel="stylesheet alternate" type="text/css" href="css/estilo3.css" title="estilo3" /> </head> <body> <noscript> Si no tenemos javascript activado saldrá este mensaje </noscript> <ul> </ul> </body> </html>
Comments
