致力于网站建设、网站设计、网站制作、网站优化、网络推广、电子样本制作、FLASH网站制作、多媒体制作等服务
换套衣服看网站:
当前位置:沐恩首页 - 技术资料 - 网站建设知识网站建设知识
几种比较常用的滑动门代码
www.muen.cc   发布时间:2011-2-19   来源:沐恩设计
内容摘要:滑动门代码,几种比较常用的滑动门代码

一、鼠标滑过切换层效果

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>沐恩网络-鼠标滑过切换层效果</title>
<style>
.title a,.title a:link,.title a:visited{display:block;float:left;padding:2px 8px;margin-right:5px;background:#996600;color:#FFFFFF;font-size:25px;}
.title a:hover{background:#999999;}
.title a.thist:link,.title a.thist:visited{background:#FF0000;}
.info{font-size:200px;width:300px;height:300px;}
.h {display:none;}
</style>
</head>
<body>
<div class="title">
<a href="javascript:void(null);" class="thist" id="a1" onmouseover="bian('a','10','1');">1</a>
<a href="javascript:void(null);" class="" id="a2" onmouseover="bian('a','10','2');">2</a>
<a href="javascript:void(null);" class="" id="a3" onmouseover="bian('a','10','3');">3</a>
<a href="javascript:void(null);" class="" id="a4" onmouseover="bian('a','10','4');">4</a>
<a href="javascript:void(null);" class="" id="a5" onmouseover="bian('a','10','5');">5</a>
<a href="javascript:void(null);" class="" id="a6" onmouseover="bian('a','10','6');">6</a>
<a href="javascript:void(null);" class="" id="a7" onmouseover="bian('a','10','7');">7</a>
<a href="javascript:void(null);" class="" id="a8" onmouseover="bian('a','10','8');">8</a>
<a href="javascript:void(null);" class="" id="a9" onmouseover="bian('a','10','9');">9</a>
<a href="javascript:void(null);" class="" id="a10" onmouseover="bian('a','10','10');">10</a>
</div>
<div class="info" id="infoa1">1</div>
<div class="info h" id="infoa2">2</div>
<div class="info h" id="infoa3">3</div>
<div class="info h" id="infoa4">4</div>
<div class="info h" id="infoa5">5</div>
<div class="info h" id="infoa6">6</div>
<div class="info h" id="infoa7">7</div>
<div class="info h" id="infoa8">8</div>
<div class="info h" id="infoa9">9</div>
<div class="info h" id="infoa10">10</div>
<script type="text/javascript">
function bian(s,n,id){
var i;
for(i=1;i<=n;i++){
if(i == id) {
document.getElementById(s+i).className="thist";
document.getElementById("info"+s+i).className="info";
} else {
document.getElementById(s+i).className="";
document.getElementById("info"+s+i).className="info h";
}
}
}
</script>
</body>
</html>

二、鼠标点击切换层代码

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>沐恩网络-鼠标点击切换层效果</title>
<script language="javascript" type="text/javascript">
function changeMc(a,b){
document.getElementById(a).style.display = "block"
document.getElementById(b).style.display = "none"
}
</script>
</head>
<body>
<a href="javascript:changeMc('1','2')">层1</a>  <a href="javascript:changeMc('2','1')">层2</a>
<div id="1" style="display: block;">==内容一 宁波网站建设==</div>
<div id="2" style="display: none;">==内容二 <a href='http://www.okjn.cn/html5/Design1/Web_Design/'><u>济南网页设计</u></a>==</div>
</body>
</html>

三、又一种鼠标滑过切换层效果

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>沐恩网络-又一种鼠标滑过切换层效果</title>
<script language="javascript" type="text/javascript">
function changeMc(a,b){
document.getElementById(a).style.display = "block"
document.getElementById(b).style.display = "none"
}
</script>
</head>
<body>
<div id="news_lbl_0">
<div onmouseover="javascript:changeMc('news_con_0','news_con_1')">
第一个层
</div>
</div>
<div id="news_lbl_1">
<div onmouseover="javascript:changeMc('news_con_1','news_con_0')">
第二个层
</div>
</div>
<!– 标签内容1 begin –>
<div id="news_con_0">
第1个层的内容,宁波网页制作
</div>
<!– 标签内容1 end –>
<!– 标签内容2 begin –>
<div id="news_con_1" style="display: none;">
第2个层的内容,宁波网页设计
</div>
<!– 标签内容2 end –>
</body>

四、多个滑动门共用同一个js

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<FCK:meta http-equiv="Content-Type" content="text/html; charset=gb2312"  />
<title>沐恩网络-多个滑动门共用同一个js</title>
<style type="text/css">
<!–
body{margin:0px;padding:0px;font-size:12px;background:#eee;line-height:20px;}
.bodyer{width:760px;margin:20px auto auto;border:1px dotted #ccc;background:#fff;}
.t_rt{text-align:right;}
h1,h2,h3,h4,h5,h6{font-weight:bold;margin:0px;padding:0px;font-size:12px;}
ul,li{margin:0px;padding:0px;}
li{list-style-type:none;}
h1{margin:10px;padding-right:10px;padding-bottom:5px;border-bottom:1px dotted #ccc;}
.preview{margin:10px;padding:10px;overflow:hidden;background:#eee;}
.cont{padding:10px;}
.cls{clear:both;}
.hidden{display:none;}
#sourse{border:1px dotted #ccc;width:600px;height:300px;margin:0px auto;}
.textDiv{margin:10px 40px 10px;text-align:center;}
h2{margin:0px 10px;background:#ccc;padding:5px;}
.example{margin:10px;background:#FFF;border:1px dotted #ccc;padding:10px;}
.scrolldoorFrame{width:400px;margin:0px auto;overflow:hidden;}
.scrollUl{width:400px;border-bottom:1px solid #CCC;overflow:hidden;height:35px;}
.scrollUl li{float:left;}
.bor03{border:1px solid #ccc;border-top-width:0px;}
.sd01{cursor:pointer;border:1px solid #CCC;background:#FFF;margin:5px;padding:2px;font-weight:bold;}
.sd02{cursor:pointer;border:0px solid #CCC;margin:5px;padding:2px;}
–>
</style>
<script type="text/javascript">
function scrollDoor(){
}
scrollDoor.prototype = {
sd : function(menus,divs,openClass,closeClass){
var _this = this;
if(menus.length != divs.length)
{
alert("菜单层数量和内容层数量不一样!");
return false;
}
for(var i = 0 ; i < menus.length ; i++)
{
_this.$(menus[i]).value = i;
_this.$(menus[i]).onmouseover = function(){
for(var j = 0 ; j < menus.length ; j++)
{
_this.$(menus[j]).className = closeClass;
_this.$(divs[j]).style.display = "none";
}
_this.$(menus[this.value]).className = openClass;
_this.$(divs[this.value]).style.display = "block";
}
}
},
$ : function(oid){
if(typeof(oid) == "string")
return document.getElementById(oid);
return oid;
}
}
window.onload = function(){
var SDmodel = new scrollDoor();
SDmodel.sd(["m01","m02","m03","m04","m05"],["c01","c02","c03","c04","c05"],"sd01","sd02");
SDmodel.sd(["mm01","mm02","mm03","mm04","mm05"],["cc01","cc02","cc03","cc04","cc05"],"sd01","sd02");
SDmodel.sd(["mmm01","mmm02","mmm03","mmm04","mmm05"],["ccc01","ccc02","ccc03","ccc04","ccc05"],"sd01","sd02");
}
</script>
</head>
<body>
<div class="bodyer">
<h1 class="t_rt">
沐恩网络-宁波网页设计-多滑动门共用一个js
</h1>
<h2>
效果预览
</h2>
<div class="preview">
<div class="scrolldoorFrame">
<ul class="scrollUl">
<li class="sd01" id="m01">A滑动门</li>
<li class="sd02" id="m02">A滑动门</li>
<li class="sd02" id="m03">A滑动门</li>
<li class="sd02" id="m04">A滑动门</li>
<li class="sd02" id="m05">A滑动门</li>
</ul>
<div class="bor03 cont">
<div id="c01">A第一层内容</div>
<div id="c02" class="hidden">A第二层内容</div>
<div id="c03" class="hidden">A第三层内容</div>
<div id="c04" class="hidden">A第四层内容</div>
<div id="c05" class="hidden">A第五层内容</div>
</div>
</div>
</div>
<div class="preview">
<div class="scrolldoorFrame">
<ul class="scrollUl">
<li class="sd01" id="mm01">B滑动门</li>
<li class="sd02" id="mm02">B滑动门</li>
<li class="sd02" id="mm03">B滑动门</li>
<li class="sd02" id="mm04">B滑动门</li>
<li class="sd02" id="mm05">B滑动门</li>
</ul>
<div class="bor03 cont">
<div id="cc01">B第一层内容</div>
<div id="cc02" class="hidden">B第二层内容</div>
<div id="cc03" class="hidden">B第三层内容</div>
<div id="cc04" class="hidden">B第四层内容</div>
<div id="cc05" class="hidden">B第五层内容</div>
</div>
</div>
</div>
<div class="preview">
<div class="scrolldoorFrame">
<ul class="scrollUl">
<li class="sd01" id="mmm01">C滑动门</li>
<li class="sd02" id="mmm02">C滑动门</li>
<li class="sd02" id="mmm03">C滑动门</li>
<li class="sd02" id="mmm04">C滑动门</li>
<li class="sd02" id="mmm05">C滑动门</li>
</ul>
<div class="bor03 cont">
<div id="ccc01">C第一层内容</div>
<div id="ccc02" class="hidden">C第二层内容</div>
<div id="ccc03" class="hidden">C第三层内容</div>
<div id="ccc04" class="hidden">C第四层内容</div>
<div id="ccc05" class="hidden">C第五层内容</div>
</div>
</div>
</div>
</div>
</body>
</html>

点击下载代码

[推荐] [收藏] [打印] [关闭]本文关键词:滑动门代码
技术资料
我们能做什么
WHO ARE YOU?
Copyright www.muen.cc 2007-2011 宁波江东君安网络科技有限公司 ALL Rights Reserved. 浙ICP备10040149号
QQ:1277845313 52707370 123557898 E-mail:muen@muen.cc 电话:0574-87080632
地址:浙江宁波朝晖路188号820室
友情链接1: ********** 澳门银河 皇冠比分网 ****** 皇冠比分网 赌场 网络赌博 网上赌博 ********** 澳门银河 ****** 线上赌博网站 ********** 网络赌博 hg1088 皇冠比分网 皇冠现金 网络赌博 ****** ****** 澳门赌场 ****** 赌博 澳门银河 澳门金沙 365bet官网 ****** 太阳城 网络赌博 hg0088 皇冠新2网址 皇冠比分网 ****娱乐场 全讯网 赌球网 太阳城 博狗体育 世爵娱乐 21点玩法 太阳城 博狗体育 网上赌博 皇冠新2网址 网上赌博 ********城 博狗体育 365bet 世爵娱乐 世爵娱乐 澳门赌场 ****** 澳门赌场 赌博游戏 世爵娱乐 ******** ********城 ******** 皇冠新2网址 全讯网 ********城 ******** 全讯网 太阳城 太阳城 香港马会开奖结果 黄大仙心水论坛 铁算盘心水论坛 六合心水论坛 天线宝宝心水论坛 蓝月亮心水论坛 一点红心水论坛 红姐心水论坛 聚宝盆心水论坛 红太阳心水论坛 创富心水论坛