每缝过年过节,各位站长都会为自己的网站换上新装,以表达自己的喜悦心情。。。
很大一部分站长选择了换网站背景来实现换新装的过程。但换一张背景图片不一定能和网站主色溶合,有时反而会事得其反。
今天我就教大家用JS和DIV+CSS实现可以关闭的网站背景效果。。。。。

可以关闭的网站背景效果
演示地址:http://www.56mp.cn/upload/closebg/
CSS部分:
<style type="text/css">
BODY { background:#515459}
#reStyle {MARGIN-TOP: 0px;DISPLAY: block; RIGHT: 150px; BACKGROUND: url(images/cl_mj_001.gif) no-repeat 0px 0px; OVERFLOW: hidden; WIDTH: 40px; CURSOR: pointer; POSITION: absolute; TOP: 20px; HEIGHT: 18px}
.RedStyle {MARGIN-TOP: 38px;BACKGROUND: url(images/bodybg.jpg) #fba500 no-repeat center top}
#top{margin:0 auto; padding-top:0; width:960px;}
</style>
HTML部分:
<BODY class=RedStyle id=body>
<DIV id=sudsclickstreamdiv
style="Z-INDEX: 1; VISIBILITY: hidden; POSITION: absolute"></DIV>
<DIV id=reStyle title=关闭背景></DIV>
<SCRIPT language=javascript type=text/javascript>
hackbase.$("reStyle").onclick = function(){
document.body.className = "";
this.style.display = "none";
};
hackbase.$("reStyle").onmouseover = function(){this.className = "hover"};
hackbase.$("reStyle").onmouseout = function(){this.className = ""};
</SCRIPT>
<div id="top"><a href="http://www.56mp.cn" target="_blank"><img src="images/56mp.gif" alt="逸诚科技" width="960" height="2072" border="0" /></a></div>
记得引用JS:
<SCRIPT src="js/hackbaseflash.js" type=text/javascript></SCRIPT>
如果有什么不明白的可以加首页上的QQ进行咨询。
转载时请注明出处。此信息出自逸诚科技:http://www.56mp.cn
◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。