Non l'ho provato. In rosso le aggiunte. Fammi sapere... P.S. Credo che affinché funzioni debba trovarsi online!
codice:<!doctype html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Pagina vuota</title> <link href="static.css" rel="stylesheet" type="text/css" /> <link href="default.css" rel="stylesheet" type="text/css" title="Default Style" /> <link href="fancy.css" rel="stylesheet" disabled="true" type="text/css" title="Fancy" /> <link href="basic.css" rel="stylesheet" disabled="true" type="text/css" title="Basic" /> <script type="text/javascript"> function chooseStyleSheet(sTitle) { if (!sTitle) { return; } for (var iStyleSh, iStyleSheetId = 0, aLinkEls = document.getElementsByTagName("link"); iStyleSheetId < aLinkEls.length; iStyleSheetId++) { iStyleSh = aLinkEls[iStyleSheetId]; if (iStyleSh.rel === "stylesheet" && iStyleSh.title) { iStyleSh.disabled = iStyleSh.title !== sTitle; } } localStorage.setItem("customStyle", sTitle); } </script> </head> <body onload="if(localStorage.hasOwnProperty('customStyle')){chooseStyleSheet(localStorage.getItem('customStyle'));}"> [ <span class="intLink" onclick="chooseStyleSheet('Default Style');">Default Style</span> | <span class="intLink" onclick="chooseStyleSheet('Fancy');">Fancy</span> | <span class="intLink" onclick="chooseStyleSheet('Basic');">Basic</span> ]</p> <span class="classeEsempio">Testo di esempio</span> </body> </html>


Rispondi quotando