幽幽
 
posts - 51,  comments - 28,  trackbacks - 0

CSS切换皮肤切换代码:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
      <head>
       
  <meta http-equiv="content-type" content="text/html;charset=gb2312" />
  <meta name="generator" content="" />
  <meta name="author" content="" />
        <meta name="keywords" content="" />
        <meta name="robots" content="index, follow" />
        <meta name="googlebot" content="index, follow" />
  <title>     </title>
  <link rel="stylesheet" type="text/css" href="code/changestyle/styles1.css" title="styles1"  media="screen" />
 <link rel="alternate stylesheet" type="text/css" href="code/changestyle/styles2.css" title="styles2" media="screen" />
 <link rel="alternate stylesheet" type="text/css" href="code/changestyle/styles3.css" title="styles3" media="screen" />
  <script type="text/javascript">
window.onload=function(){ var c = readCookie('style');
 if (c) switchStylestyle(c);
};
function switchStylestyle(styleName)
{  aa=document.styleSheets;
for(i=0;i<aa.length;i++)
 {
  aa[i].disabled = true;
  if (aa[i].title== styleName){aa[i].disabled = false;}
 };
 createCookie('style', styleName, 365);
}
function createCookie(name,value,days)
{
 if (days)
 {
  var date = new Date();
  date.setTime(date.getTime()+(days*24*60*60*1000));
  var expires = "; expires="+date.toGMTString();
 }
 else var expires = "";
 document.cookie = name+"="+value+expires+"; path=/";
}
function readCookie(name)
{
 var nameEQ = name + "=";
 var ca = document.cookie.split(';');
 for(var i=0;i < ca.length;i++)
 {
  var c = ca[i];
  while (c.charAt(0)==' ') c = c.substring(1,c.length);
  if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
 }
 return null;
}
function eraseCookie(name)
{
 createCookie(name,"",-1);
}
// /cookie functions
  </script>
 </head>
 <body id="">
  <div id="wrapper">
   <ul>
  <li><a href="javascript:void(0);" onclick="switchStylestyle('styles1')">styles1</a></li>
  <li><a href="javascript:void(0);" onclick="switchStylestyle('styles2')">styles2</a></li>
  <li><a href="javascript:void(0);" onclick="switchStylestyle('styles3')">styles3</a></li>
 </ul
  </div>
 </body>
</html>


posted on 2009-04-20 03:22 幽幽 阅读(799) 评论(0)  编辑 收藏 引用 所属分类: web开发

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理



<2024年4月>
31123456
78910111213
14151617181920
21222324252627
2829301234
567891011

常用链接

留言簿(5)

随笔分类(35)

随笔档案(51)

文章分类(3)

文章档案(3)

相册

我的链接

搜索

  •  

最新评论

阅读排行榜

评论排行榜