一款实用的选项卡滑动门特效代码,这几有几款供您选择使用,根据自己的需求来修改下样式可以使用了。
<!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=gb2312" /> <meta name="keywords" content="武鸣人网站,武鸣信息网,武鸣本地网,武鸣信息资源平台,减肥,健身,励志,励志语录,js特效,网页特效,www.wuming.ren"> <meta name="description" content="欢迎来到武鸣人信息资源平台,各种信息免费发布,资源共享合作共赢,分享互联网流行的励志语录经典短句,减肥健身健康小常识及打卡记录,收集各种js特效代码。"> <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 50px 50px 50px;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(){ }//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀) scrollDoor.prototype = { sd : function(menus,divs,openClass,closeClass){ var _this = this; if(menus.length != divs.length) { alert("菜单层数量和内容层数量不一样!"); return false; }//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀) 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; } }//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀) 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"); }//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀) </script> </head> <body> <a href="https://www.wuming.ren">武鸣人</a>,各种信息资源免费发布,分享励志语录经典短句,减肥健身常识,各种js特效代码。网站很好记住,wuming.ren(武鸣拼音.ren域名后缀)<hr> <!--欢迎来到武鸣人信息资源平台,各种信息免费发布,资源共享合作共赢,分享互联网流行的励志语录经典短句,减肥健身健康小常识及打卡记录,收集各种js特效代码。--> <script type="text/javascript" src="https://www.wuming.ren/ad/tc.js"></script> <script type="text/javascript" src="https://www.wuming.ren/ad/a.js"></script> <div class="bodyer"> <h1 class="t_rt"> 滑动门封装类 </h1> <h2> 效果预览 </h2> <div class="preview"> <div class="scrolldoorFrame"> <ul class="scrollUl"> <li class="sd01" id="m01">滑动门</li> <li class="sd02" id="m02">滑动门</li> <li class="sd02" id="m03">滑动门</li> <li class="sd02" id="m04">滑动门</li> <li class="sd02" id="m05">滑动门</li> </ul> <div class="bor03 cont"> <div id="c01"> 武鸣人一号内容 </div> <div id="c02" class="hidden"> 武鸣人二号内容 </div> <div id="c03" class="hidden"> 武鸣人三号内容 </div> <div id="c04" class="hidden"> 武鸣人四号内容 </div> <div id="c05" class="hidden"> 武鸣人五号内容 </div> </div> </div> </div> <div class="preview"> <div class="scrolldoorFrame"> <ul class="scrollUl"> <li class="sd01" id="mm01">滑动门</li> <li class="sd02" id="mm02">滑动门</li> <li class="sd02" id="mm03">滑动门</li> <li class="sd02" id="mm04">滑动门</li> <li class="sd02" id="mm05">滑动门</li> </ul> <div class="bor03 cont"> <div id="cc01"> 武鸣人一号内容 </div> <div id="cc02" class="hidden"> 武鸣人二号内容 </div> <div id="cc03" class="hidden"> 武鸣人三号内容 </div> <div id="cc04" class="hidden"> 武鸣人四号内容 </div> <div id="cc05" class="hidden"> 武鸣人五号内容 </div> </div> </div> </div> <div class="preview"> <div class="scrolldoorFrame"> <ul class="scrollUl"> <li class="sd01" id="mmm01">滑动门</li> <li class="sd02" id="mmm02">滑动门</li> <li class="sd02" id="mmm03">滑动门</li> <li class="sd02" id="mmm04">滑动门</li> <li class="sd02" id="mmm05">滑动门</li> </ul> <div class="bor03 cont"> <div id="ccc01"> 武鸣人一号内容 </div> <div id="ccc02" class="hidden"> 武鸣人二号内容 </div> <div id="ccc03" class="hidden"> 武鸣人三号内容 </div> <div id="ccc04" class="hidden"> 武鸣人四号内容 </div> <div id="ccc05" class="hidden"> 武鸣人五号内容 </div> </div> </div> </div> </div> </body> </html>
本文来自武鸣人网站,转载请注明出处