步骤1. -->
下载styleswitcher.rar 解压出的js放入你需要的目录里, 并在<head>加上
<script type="text/javascript" src="(目标路径)styleswitcher.js"></script>
步骤2. -->
将欲加入的css style 依次列进<head>
第一行stylesheet 为预设的style, 其它alternate stylesheet 为选项style, 然后自定title 名称(如以下蓝字)
<link rel="stylesheet" type="text/css" href="css/index01.css" title="green">
<link rel="alternate stylesheet" type="text/css" href="css/index02.css" title="yellow">
<link rel="alternate stylesheet" type="text/css" href="css/index03.css" title="purple">
步骤3. -->
内容html选项的写法如下, 以下的红字部分需逐一对应步骤2的蓝字才能趋动所命名的style
更换页面风格 :
<a href="css/index01.css" onclick="setActiveStyleSheet('green'); return false;">绿色</a>
<a href="css/index02.css" onclick="setActiveStyleSheet('yellow'); return false;">褐色</a>
<a href="css/index03.css" onclick="setActiveStyleSheet('purple'); return false;">紫色</a>
虽然有预设的style, 但因为js中有 Cookie 写法, 下次再开启时会以上次最后设定的style为当前style。
下载styleswitcher.rar 解压出的js放入你需要的目录里, 并在<head>加上
<script type="text/javascript" src="(目标路径)styleswitcher.js"></script>
步骤2. -->
将欲加入的css style 依次列进<head>
第一行stylesheet 为预设的style, 其它alternate stylesheet 为选项style, 然后自定title 名称(如以下蓝字)
<link rel="stylesheet" type="text/css" href="css/index01.css" title="green">
<link rel="alternate stylesheet" type="text/css" href="css/index02.css" title="yellow">
<link rel="alternate stylesheet" type="text/css" href="css/index03.css" title="purple">
步骤3. -->
内容html选项的写法如下, 以下的红字部分需逐一对应步骤2的蓝字才能趋动所命名的style
更换页面风格 :
<a href="css/index01.css" onclick="setActiveStyleSheet('green'); return false;">绿色</a>
<a href="css/index02.css" onclick="setActiveStyleSheet('yellow'); return false;">褐色</a>
<a href="css/index03.css" onclick="setActiveStyleSheet('purple'); return false;">紫色</a>
虽然有预设的style, 但因为js中有 Cookie 写法, 下次再开启时会以上次最后设定的style为当前style。
苹果CEO史蒂夫·乔布斯:我如
写给WEB2.0的团队、公司 

2008/08/06 17:58 | by 








