百度tab标签切换效果,鼠标经过切换显示,也可以直接点击左右切换箭头实现tab切换效果。
<!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" /> <title>模拟百度风云榜TAB标签切换效果_武鸣人</title> <meta name="keywords" content="武鸣人网站,武鸣信息网,武鸣本地网,武鸣信息资源平台,减肥,健身,励志,励志语录,js特效,网页特效,www.wuming.ren"> <meta name="description" content="欢迎来到武鸣人信息资源平台,各种信息免费发布,资源共享合作共赢,分享互联网流行的励志语录经典短句,减肥健身健康小常识及打卡记录,收集各种js特效代码。"> <style> body,div,h5,ul,li{margin:0;padding:0;} body{font:12px/1.5 Arial;} li{list-style:none;} a:link,a:visited{color:#333;text-decoration:none;} a:hover{text-decoration:underline;} #wrap_www_wuming_ren{width:836px;border:3px solid #1972C0;border-width:3px 0;margin:10px auto;} #list{overflow:hidden;zoom:1;margin-left:-10px;} #wrap_www_wuming_ren .item{display:inline;float:left;width:270px;padding-bottom:10px;border:1px solid #EBEBEB;margin:10px 0 10px 10px;} #wrap_www_wuming_ren .item .tab{position:relative;height:25px;border-bottom:1px solid #CCC;margin:8px;} #wrap_www_wuming_ren .item .tab h5{position:absolute;left:10px;font-size:14px;} #wrap_www_wuming_ren .item .tab .switchBtn{position:absolute;top:3px;right:0;} #wrap_www_wuming_ren .item .tab .switchBtn a{float:left;width:15px;height:15px;margin-left:5px;overflow:hidden;text-indent:-999px;background:url(/img/20240220_wuming_ren_52.gif) no-repeat;outline:none;} #wrap_www_wuming_ren .item .tab .switchBtn a.prev{background-position:0 -25px;} #wrap_www_wuming_ren .item .tab .switchBtn a.prevNot{background-position:0 0;cursor:default;} #wrap_www_wuming_ren .item .tab .switchBtn a.next{background-position:right -25px;} #wrap_www_wuming_ren .item .tab .switchBtn a.nextNot{background-position:right 0;cursor:default;} #wrap_www_wuming_ren .item .tab ul{position:absolute;top:-2px;left:50px;width:160px;height:28px;overflow:hidden;} #wrap_www_wuming_ren .item .tab ul li{float:left;cursor:pointer;line-height:26px;padding:0 8px;} #wrap_www_wuming_ren .item .tab ul li.current{cursor:text;color:#E45E2E;font-weight:700;border:1px solid #CCC;border-bottom-color:#FFF;} #wrap_www_wuming_ren .item .items{display:none;background:url(/img/20240220_wuming_ren_53.gif) 15px 4px no-repeat;padding:0 15px;} #wrap_www_wuming_ren .item .items a{color:#3A64B0;} #wrap_www_wuming_ren .item .items li{height:24px;line-height:24px;padding-left:20px;border-bottom:1px solid #EBEBEB;} #wrap_www_wuming_ren .item .btn{height:22px;margin-top:10px;} #wrap_www_wuming_ren .item .btn a{float:right;width:74px;height:22px;overflow:hidden;margin-right:15px;text-indent:-9999px;background:url(/img/20240220_wuming_ren_54.gif) no-repeat;} #wrap_www_wuming_ren .item .btn a:hover{background-position:0 -22px;} </style> <script> var fgm = { $: function(id) { return typeof id === "object" ? id : document.getElementById(id); }, $$: function(tagName, oParent) { return (oParent || document).getElementsByTagName(tagName); }, $$$: function(className, element, tagName) { var i = 0, aClass = [], reClass = new RegExp("(^|\\s)" + className + "(\\s|$)"), aElement = fgm.$$(tagName || "*", element || document); for (i = 0; i < aElement.length; i++) reClass.test(aElement[i].className) && aClass.push(aElement[i]); return aClass; }, index: function(element) { var aChildren = element.parentNode.children, i; for(i = 0; i < aChildren.length; i++) if(aChildren[i] === element) return i; return -1; }, on: function(element, type, handler) { return element.addEventListener ? element.addEventListener(type, handler, !1) : element.attachEvent("on" + type, handler); }, bind: function(object, handler) { return function() { return handler.apply(object, arguments); }; } };//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀) function tab_www_www_wuming_ren(id) { this.obj = fgm.$(id); this.oTab = fgm.$$$("tab", this.obj)[0]; this.aTab = fgm.$$("li", this.oTab); this.oSwitch = fgm.$$$("switchBtn", this.oTab)[0]; this.oPrev = fgm.$$("a", this.oSwitch)[0]; this.oNext = fgm.$$("a", this.oSwitch)[1]; this.aItems = fgm.$$$("items", this.obj); this.iNow = 0; fgm.on(this.oSwitch, "click", fgm.bind(this, this.fnClick)); fgm.on(this.oTab, "mouseover", fgm.bind(this, this.fnMouseOver)); }//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀) tab_www_www_wuming_ren.prototype = { fnMouseOver: function(ev) { var oEv = ev || event, oTarget = oEv.target || oEv.srcElement; oTarget.tagName.toUpperCase() === "LI" && (this.iNow = fgm.index(oTarget)); this.fnSwitch(); }, fnClick: function(ev) { var oEv = ev || event, oTarget = oEv.target || oEv.srcElement, i; switch(fgm.index(oTarget)) { case 0: if(oTarget.className == "prev") { this.aTab[this.iNow].style.display = "block"; this.iNow--; }; break; case 1: if(oTarget.className == "next") { for(i = 0; i < this.iNow; i++) this.aTab[i].style.display = "none"; this.iNow++; }; break; }; this.aTab[this.iNow].style.display = "block"; this.fnSwitch(); }, fnSwitch: function() { for(var i = 0; i < this.aTab.length; i++) (this.aTab[i].className = "", this.aItems[i].style.display = "none"); this.aTab[this.iNow].className = "current"; this.aItems[this.iNow].style.display = "block"; this.oPrev.className = this.iNow == 0 ? "prevNot" : "prev"; this.oNext.className = this.iNow == this.aTab.length - 1 ? "nextNot" : "next"; } }; //武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀) //应用 fgm.on(window, "load", function() { var aItem = fgm.$$$("item"), i = 0; for(; i < aItem.length; i++) new tab_www_www_wuming_ren(aItem[i]); }); </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 id="wrap_www_wuming_ren"> <div id="list"> <div class="item"> <div class="tab"> <h5><a href="https://wuming.ren">教育</a></h5> <ul> <li class="current">基础教育</li> <li>英语培训</li> <li>留学机构</li> <li>语言培训</li> <li>IT培训</li> </ul> <span class="switchBtn"><a href="javascript:;" class="prevNot">左</a><a href="javascript:;" class="next">右</a></span> </div> <ul class="items" style="display:block;"> <li><a href="https://wuming.ren">北京四中网校</a></li> <li><a href="https://wuming.ren">学大教育</a></li> <li><a href="https://wuming.ren">中国统一教育网</a></li> <li><a href="https://wuming.ren">101远程教育网</a></li> <li><a href="https://wuming.ren">巨人教育</a></li> <li><a href="https://wuming.ren">黄冈中学网校</a></li> </ul> <ul class="items"> <li><a href="https://wuming.ren">新东方</a></li> <li><a href="https://wuming.ren">英孚教育</a></li> <li><a href="https://wuming.ren">环球雅思</a></li> <li><a href="https://wuming.ren">韦博国际英语</a></li> <li><a href="https://wuming.ren">华尔街英语</a></li> <li><a href="https://wuming.ren">新航道</a></li> </ul> <ul class="items"> <li><a href="https://wuming.ren">2+2留学</a></li> <li><a href="https://wuming.ren">澳际留学</a></li> <li><a href="https://wuming.ren">新东方前途出国</a></li> <li><a href="https://wuming.ren">启德留学</a></li> <li><a href="https://wuming.ren">嘉华世达</a></li> <li><a href="https://wuming.ren">金吉列留学</a></li> </ul> <ul class="items"> <li><a href="https://wuming.ren">新东方</a></li> <li><a href="https://wuming.ren">英孚教育</a></li> <li><a href="https://wuming.ren">昂立教育</a></li> <li><a href="https://wuming.ren">环球雅思</a></li> <li><a href="https://wuming.ren">韦博国际英语</a></li> <li><a href="https://wuming.ren">华尔街英语</a></li> </ul> <ul class="items"> <li><a href="https://wuming.ren">北大青鸟</a></li> <li><a href="https://wuming.ren">新华电脑学校</a></li> <li><a href="https://wuming.ren">完美动力</a></li> <li><a href="https://wuming.ren">达内培训</a></li> <li><a href="https://wuming.ren">汇众教育</a></li> <li><a href="https://wuming.ren">思远IT学院</a></li> </ul> <div class="btn"><a href="https://wuming.ren">完整榜单</a></div> </div> <div class="item"> <div class="tab"> <h5><a href="https://wuming.ren">教育</a></h5> <ul> <li class="current">基础教育</li> <li>英语培训</li> <li>留学机构</li> <li>语言培训</li> <li>IT培训</li> </ul> <span class="switchBtn"><a href="javascript:;" class="prevNot">左</a><a href="javascript:;" class="next">右</a></span> </div> <ul class="items" style="display:block;"> <li><a href="https://wuming.ren">北京四中网校</a></li> <li><a href="https://wuming.ren">学大教育</a></li> <li><a href="https://wuming.ren">中国统一教育网</a></li> <li><a href="https://wuming.ren">101远程教育网</a></li> <li><a href="https://wuming.ren">巨人教育</a></li> <li><a href="https://wuming.ren">黄冈中学网校</a></li> </ul> <ul class="items"> <li><a href="https://wuming.ren">新东方</a></li> <li><a href="https://wuming.ren">英孚教育</a></li> <li><a href="https://wuming.ren">环球雅思</a></li> <li><a href="https://wuming.ren">韦博国际英语</a></li> <li><a href="https://wuming.ren">华尔街英语</a></li> <li><a href="https://wuming.ren">新航道</a></li> </ul> <ul class="items"> <li><a href="https://wuming.ren">2+2留学</a></li> <li><a href="https://wuming.ren">澳际留学</a></li> <li><a href="https://wuming.ren">新东方前途出国</a></li> <li><a href="https://wuming.ren">启德留学</a></li> <li><a href="https://wuming.ren">嘉华世达</a></li> <li><a href="https://wuming.ren">金吉列留学</a></li> </ul> <ul class="items"> <li><a href="https://wuming.ren">新东方</a></li> <li><a href="https://wuming.ren">英孚教育</a></li> <li><a href="https://wuming.ren">昂立教育</a></li> <li><a href="https://wuming.ren">环球雅思</a></li> <li><a href="https://wuming.ren">韦博国际英语</a></li> <li><a href="https://wuming.ren">华尔街英语</a></li> </ul> <ul class="items"> <li><a href="https://wuming.ren">北大青鸟</a></li> <li><a href="https://wuming.ren">新华电脑学校</a></li> <li><a href="https://wuming.ren">完美动力</a></li> <li><a href="https://wuming.ren">达内培训</a></li> <li><a href="https://wuming.ren">汇众教育</a></li> <li><a href="https://wuming.ren">思远IT学院</a></li> </ul> <div class="btn"><a href="https://wuming.ren">完整榜单</a></div> </div> <div class="item"> <div class="tab"> <h5><a href="https://wuming.ren">教育</a></h5> <ul> <li class="current">基础教育</li> <li>英语培训</li> <li>留学机构</li> <li>语言培训</li> <li>IT培训</li> </ul> <span class="switchBtn"><a href="javascript:;" class="prevNot">左</a><a href="javascript:;" class="next">右</a></span> </div> <ul class="items" style="display:block;"> <li><a href="https://wuming.ren">北京四中网校</a></li> <li><a href="https://wuming.ren">学大教育</a></li> <li><a href="https://wuming.ren">中国统一教育网</a></li> <li><a href="https://wuming.ren">101远程教育网</a></li> <li><a href="https://wuming.ren">巨人教育</a></li> <li><a href="https://wuming.ren">黄冈中学网校</a></li> </ul> <ul class="items"> <li><a href="https://wuming.ren">新东方</a></li> <li><a href="https://wuming.ren">英孚教育</a></li> <li><a href="https://wuming.ren">环球雅思</a></li> <li><a href="https://wuming.ren">韦博国际英语</a></li> <li><a href="https://wuming.ren">华尔街英语</a></li> <li><a href="https://wuming.ren">新航道</a></li> </ul> <ul class="items"> <li><a href="https://wuming.ren">2+2留学</a></li> <li><a href="https://wuming.ren">澳际留学</a></li> <li><a href="https://wuming.ren">新东方前途出国</a></li> <li><a href="https://wuming.ren">启德留学</a></li> <li><a href="https://wuming.ren">嘉华世达</a></li> <li><a href="https://wuming.ren">金吉列留学</a></li> </ul> <ul class="items"> <li><a href="https://wuming.ren">新东方</a></li> <li><a href="https://wuming.ren">英孚教育</a></li> <li><a href="https://wuming.ren">昂立教育</a></li> <li><a href="https://wuming.ren">环球雅思</a></li> <li><a href="https://wuming.ren">韦博国际英语</a></li> <li><a href="https://wuming.ren">华尔街英语</a></li> </ul> <ul class="items"> <li><a href="https://wuming.ren">北大青鸟</a></li> <li><a href="https://wuming.ren">新华电脑学校</a></li> <li><a href="https://wuming.ren">完美动力</a></li> <li><a href="https://wuming.ren">达内培训</a></li> <li><a href="https://wuming.ren">汇众教育</a></li> <li><a href="https://wuming.ren">思远IT学院</a></li> </ul> <div class="btn"><a href="https://wuming.ren">完整榜单</a></div> </div> </div> <!--/list--> </div> <!--/wrap_www_wuming_ren--> </body> </html>
本文来自武鸣人网站,转载请注明出处