- ·上一篇站长学习:初学建站应知:网站文件命名规范
- ·下一篇站长学习:实现CSS制作网页时绝对居中问题的总结
DIV+CSS布局网页页面实现多风格选择的方法
1. styleswitcher.js
| 以下为引用的内容: function setActiveStyleSheet(title) { function getActiveStyleSheet() { 515down.com function getPreferredStyleSheet() { 515down.com function createCookie(name,value,days) { function readCookie(name) { window.onload = function(e) { 515down.com window.onunload = function(e) { var cookie = readCookie("style"); |
CODE:
| 以下为引用的内容: <link rel="stylesheet" type="text/css" href="default.css" /> //默认的样式这样调用 |
515down.com
3、JS调用: 515down.com
CODE:
| 以下为引用的内容: <script type="text/javascript" src="styleswitcher.js"></script> |
写在页面的body中 515down.com
| 以下为引用的内容: <a href="#" onclick="setActiveStyleSheet('',1); return false;">默认样式</a> <a href="#" onclick="setActiveStyleSheet('name_one',1); return false;">样式一</a> <a href="#" onclick="setActiveStyleSheet('name_two',1); return false;">样式二</a> |






