家园首页 Php4手册 我的相册 家园下载 个人文集 给我留言
我形我塑,网络相册,www.5x54.com 相册 相册 心情相册,少女相册 免费申请,我形我塑免费相册
 家园 个人文集   http://www.5x54.com
 


仿腾讯QQ首页无刷新换肤切换样式实例


作者:网上收集    点击: 读取中...

引用代码:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> (%$$#^31967*&%2)我型我塑www.5x54.com
<html xmlns="http://www.w3.org/1999/xhtml"> (%$$#^31967*&%2)我型我塑www.5x54.com
<head> (%$$#^31967*&%2)我型我塑www.5x54.com
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> (%$$#^31967*&%2)我型我塑www.5x54.com
<title>换肤</title> (%$$#^31967*&%2)我型我塑www.5x54.com
<style type="text/css"> (%$$#^31967*&%2)我型我塑www.5x54.com
body{font-size:12px} (%$$#^31967*&%2)我型我塑www.5x54.com
*{margin:0;padding:0;} (%$$#^31967*&%2)我型我塑www.5x54.com
ul,li{list-style:none} (%$$#^31967*&%2)我型我塑www.5x54.com
.login_skin{height:25px;background:#E8E8E8;border:1px solid #e9e8e5;width:215px;color:#333;line-height:25px;margin:25px 0px 25px 10px;padding-left:15px;} (%$$#^31967*&%2)我型我塑www.5x54.com
.login_skin li{float:left} (%$$#^31967*&%2)我型我塑www.5x54.com
.login_skin .bor{border-right:1px solid #e9e8e5; padding-right:7px; margin-right:10px} (%$$#^31967*&%2)我型我塑www.5x54.com
.login_skin li span{margin:7px 4px 0px 0px;cursor:pointer;display:block} (%$$#^31967*&%2)我型我塑www.5x54.com
.login_skin li span em{display:block;height:9px;width:10px;overflow:hidden;text-indent:-9999px} (%$$#^31967*&%2)我型我塑www.5x54.com
.login_skin a{color:#333;text-decoration:none; margin-right:5px} (%$$#^31967*&%2)我型我塑www.5x54.com
.login_skin li .on{ border:1px solid #333;cursor:default} (%$$#^31967*&%2)我型我塑www.5x54.com
h2{font-size:12px; padding:8px 0px 10px 15px} (%$$#^31967*&%2)我型我塑www.5x54.com
#sk_blue{background:#2086b3;} (%$$#^31967*&%2)我型我塑www.5x54.com
#sk_or{background:#e64c13} (%$$#^31967*&%2)我型我塑www.5x54.com
#sk_byu{background:#b7a37a;} (%$$#^31967*&%2)我型我塑www.5x54.com
#warpper{overflow:hidden;height:1%} (%$$#^31967*&%2)我型我塑www.5x54.com
.contentl{margin-right:-244px;float:left;width:100%} (%$$#^31967*&%2)我型我塑www.5x54.com
.contentr{width:230px;float:right;} (%$$#^31967*&%2)我型我塑www.5x54.com
.main{margin-right:254px;margin-left:10px;height:300px} (%$$#^31967*&%2)我型我塑www.5x54.com
.footer{height:30px;margin:30px 10px 0px 10px} (%$$#^31967*&%2)我型我塑www.5x54.com
.blue .content{background:#2086b3;color:#fff;} (%$$#^31967*&%2)我型我塑www.5x54.com
.blue .bb{border:2px solid #2086b3;} (%$$#^31967*&%2)我型我塑www.5x54.com
.blue .bb h2{ color:#2086b3} (%$$#^31967*&%2)我型我塑www.5x54.com
.blue .footer{background:#2086b3;} (%$$#^31967*&%2)我型我塑www.5x54.com
.or .content{background:#e64c13} (%$$#^31967*&%2)我型我塑www.5x54.com
.or .bb{border:2px solid #e64c13;} (%$$#^31967*&%2)我型我塑www.5x54.com
.or .bb h2{ color:#e64c13} (%$$#^31967*&%2)我型我塑www.5x54.com
.or .footer{background:#e64c13;} (%$$#^31967*&%2)我型我塑www.5x54.com
.byu .content{background:#b7a37a;color:#f00} (%$$#^31967*&%2)我型我塑www.5x54.com
.byu .bb{border:2px solid #b7a37a;} (%$$#^31967*&%2)我型我塑www.5x54.com
.byu .bb h2{ color:#b7a37a} (%$$#^31967*&%2)我型我塑www.5x54.com
.byu .footer{background:#b7a37a;} (%$$#^31967*&%2)我型我塑www.5x54.com
</style> (%$$#^31967*&%2)我型我塑www.5x54.com
<script type="text/javascript"> (%$$#^31967*&%2)我型我塑www.5x54.com
function setOnloadEvent(func){ (%$$#^31967*&%2)我型我塑www.5x54.com
var oldonload = window.onload; (%$$#^31967*&%2)我型我塑www.5x54.com
if(typeof window.onload != "function"){ (%$$#^31967*&%2)我型我塑www.5x54.com
window.onload = func; (%$$#^31967*&%2)我型我塑www.5x54.com
} (%$$#^31967*&%2)我型我塑www.5x54.com
else{ (%$$#^31967*&%2)我型我塑www.5x54.com
  window.onload = function(){ (%$$#^31967*&%2)我型我塑www.5x54.com
   oldonload(); (%$$#^31967*&%2)我型我塑www.5x54.com
   func(); (%$$#^31967*&%2)我型我塑www.5x54.com
  } (%$$#^31967*&%2)我型我塑www.5x54.com
} (%$$#^31967*&%2)我型我塑www.5x54.com
} (%$$#^31967*&%2)我型我塑www.5x54.com
// --- 设置cookie (%$$#^31967*&%2)我型我塑www.5x54.com
function setCookie(name,value,days) { (%$$#^31967*&%2)我型我塑www.5x54.com
if (days) { (%$$#^31967*&%2)我型我塑www.5x54.com
  var date = new Date(); (%$$#^31967*&%2)我型我塑www.5x54.com
  date.setTime(date.getTime()+(days*24*60*60*1000)); (%$$#^31967*&%2)我型我塑www.5x54.com
  var expires = "; expires="+date.toGMTString(); (%$$#^31967*&%2)我型我塑www.5x54.com
} (%$$#^31967*&%2)我型我塑www.5x54.com
else expires = ""; (%$$#^31967*&%2)我型我塑www.5x54.com
document.cookie = name+"="+value+expires+"; path=/"; (%$$#^31967*&%2)我型我塑www.5x54.com
} (%$$#^31967*&%2)我型我塑www.5x54.com
//--- 获取cookie (%$$#^31967*&%2)我型我塑www.5x54.com
function getCookie(name) { (%$$#^31967*&%2)我型我塑www.5x54.com
var nameEQ = name + "="; (%$$#^31967*&%2)我型我塑www.5x54.com
var ca = document.cookie.split(';'); (%$$#^31967*&%2)我型我塑www.5x54.com
for(var i=0;i < ca.length;i++) { (%$$#^31967*&%2)我型我塑www.5x54.com
  var c = ca; (%$$#^31967*&%2)我型我塑www.5x54.com
  while (c.charAt(0)==' ') c = c.substring(1,c.length); (%$$#^31967*&%2)我型我塑www.5x54.com
  if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); (%$$#^31967*&%2)我型我塑www.5x54.com
} (%$$#^31967*&%2)我型我塑www.5x54.com
return null; (%$$#^31967*&%2)我型我塑www.5x54.com
} (%$$#^31967*&%2)我型我塑www.5x54.com
function skin(){ (%$$#^31967*&%2)我型我塑www.5x54.com
if(!document.getElementsByTagName) return false; (%$$#^31967*&%2)我型我塑www.5x54.com
if(!document.getElementById("skin")) return false; (%$$#^31967*&%2)我型我塑www.5x54.com
var skin_id="blue"; (%$$#^31967*&%2)我型我塑www.5x54.com
if(getCookie("id")!=null){ (%$$#^31967*&%2)我型我塑www.5x54.com
   skin_id=getCookie("id"); (%$$#^31967*&%2)我型我塑www.5x54.com
  } (%$$#^31967*&%2)我型我塑www.5x54.com
var span_id=skin_id+"_sp"; (%$$#^31967*&%2)我型我塑www.5x54.com
var span_on=document.getElementById(span_id); (%$$#^31967*&%2)我型我塑www.5x54.com
document.body.className=skin_id; (%$$#^31967*&%2)我型我塑www.5x54.com
span_on.className="on"; (%$$#^31967*&%2)我型我塑www.5x54.com
var skinType=document.getElementById("skin"); (%$$#^31967*&%2)我型我塑www.5x54.com
var skin_nub=skinType.getElementsByTagName("em"); (%$$#^31967*&%2)我型我塑www.5x54.com
for(var i=0; i<skin_nub.length;i++){ (%$$#^31967*&%2)我型我塑www.5x54.com
  skin_nub.onclick=function(){ (%$$#^31967*&%2)我型我塑www.5x54.com
  var em_id=this.getAttribute("id"); (%$$#^31967*&%2)我型我塑www.5x54.com
  var skin_id=em_id.split("_")[1]; (%$$#^31967*&%2)我型我塑www.5x54.com
  var spanList=document.getElementsByTagName("span"); (%$$#^31967*&%2)我型我塑www.5x54.com
  for(var j=0;j<spanList.length;j++){ (%$$#^31967*&%2)我型我塑www.5x54.com
    spanList[j].className=""; (%$$#^31967*&%2)我型我塑www.5x54.com
    if(spanList[j].getAttribute("id").indexOf(skin_id)!=-1) (%$$#^31967*&%2)我型我塑www.5x54.com
    { (%$$#^31967*&%2)我型我塑www.5x54.com
    spanList[j].className="on"; (%$$#^31967*&%2)我型我塑www.5x54.com
    } (%$$#^31967*&%2)我型我塑www.5x54.com
  } (%$$#^31967*&%2)我型我塑www.5x54.com
   document.body.className=skin_id; (%$$#^31967*&%2)我型我塑www.5x54.com
  setCookie("id",skin_id,1); (%$$#^31967*&%2)我型我塑www.5x54.com
  } (%$$#^31967*&%2)我型我塑www.5x54.com
} (%$$#^31967*&%2)我型我塑www.5x54.com
} (%$$#^31967*&%2)我型我塑www.5x54.com
setOnloadEvent(skin);  (%$$#^31967*&%2)我型我塑www.5x54.com
</script> (%$$#^31967*&%2)我型我塑www.5x54.com
</head> (%$$#^31967*&%2)我型我塑www.5x54.com
<body> (%$$#^31967*&%2)我型我塑www.5x54.com
<div id="header"> (%$$#^31967*&%2)我型我塑www.5x54.com
<div class="login_skin" id="skin"> (%$$#^31967*&%2)我型我塑www.5x54.com
<ul> (%$$#^31967*&%2)我型我塑www.5x54.com
<li>选择页面风格:</li> (%$$#^31967*&%2)我型我塑www.5x54.com
<li><span id="blue_sp"><em id="sk_blue">ee</em></span></li> (%$$#^31967*&%2)我型我塑www.5x54.com
<li><span id="or_sp"><em id="sk_or">ere</em></span></li> (%$$#^31967*&%2)我型我塑www.5x54.com
<li><span id="byu_sp"><em id="sk_byu">ere</em></span></li> (%$$#^31967*&%2)我型我塑www.5x54.com
</ul> (%$$#^31967*&%2)我型我塑www.5x54.com
</div> (%$$#^31967*&%2)我型我塑www.5x54.com
</div> (%$$#^31967*&%2)我型我塑www.5x54.com
<div id="warpper"> (%$$#^31967*&%2)我型我塑www.5x54.com
<div class="contentl" > (%$$#^31967*&%2)我型我塑www.5x54.com
  <div class="main bb"><h2>换肤测试</h2></div> (%$$#^31967*&%2)我型我塑www.5x54.com
</div> (%$$#^31967*&%2)我型我塑www.5x54.com
<div class="contentr bb" ><h2>换肤测试</h2></div> (%$$#^31967*&%2)我型我塑www.5x54.com
</div> (%$$#^31967*&%2)我型我塑www.5x54.com
<div class="footer"></div> (%$$#^31967*&%2)我型我塑www.5x54.com
</body> (%$$#^31967*&%2)我型我塑www.5x54.com
</html>

收藏此文章     打印  更新     编辑此文章    『关闭窗口』