Javascript + css tabs and sliding menu

Source: Internet
Author: User
Tip: you can modify some code before running

<p><meta content="text/html;charset=gb2312" http-equiv="content-type" /></p><!--把下面代码加到<pead>与</pead>之间--><p><style type="text/css"><!--* { margin:0; padding:0; font-size:12px; font-weight:normal; }.jj { font-weight:bolder!important; }.box { border-top-color:#c00!important; }.pr { color:#060!important; }#tab01 { position:relative; width:336px; height:88px; padding-top:15px; margin:50px; overflow:hidden; }#tab01 h3 { position:relative; z-index:2; float:left; height:14px; padding:0 7px 0 8px; margin-left:-1px; border-left:solid 1px #ccc; border-right:solid 1px #fff; text-align:center; background:#fff; cursor:pointer; }#tab01 h3.up { height:18px; padding:5px 7px 0 7px; margin:-6px 0 0 0; border:solid #ccc; border-width:1px 1px 0; color:#c00; }#tab01 div { display:none; position:absolute; left:0; top:32px; z-index:1; width:324px; height:54px; padding:5px; border:solid 1px #ccc; color:#666; }#tab01 div.up { display:block; }#tab02 { position:relative; width:200px; margin:50px; border:solid #ccc; border-width:0 1px 1px; }#tab02 h4 { height:18px; line-height:18px; border:solid #ccc; border-width:1px 0; margin-bottom:-1px; text-align:center; background:#f6f6f6; cursor:pointer; }#tab02 h4.up { color:#c00; }#tab02 ol { display:none; height:54px; padding:5px; color:#666; }#tab02 ol.up { display:block; }#tab03 { position:relative; width:100px; margin:50px; }#tab03 h3 { position:relative; z-index:1; height:16px; padding-top:4px; margin-bottom:-1px; border:solid #ccc; border-width:1px 0 1px 1px; text-align:center; font-family:宋体; background:#eee; cursor:pointer; }#tab03 h3.up { z-index:3; color:#c00; background:#fff; }#tab03 div.tab { display:none; position:absolute; left:99px; top:0; z-index:2; width:300px; height:200px; padding:5px; border:solid 1px #ccc; color:#666; }#tab03 div.tab.up { display:block; }--></style></p><!--把下面代码加到<body>与</body>之间--><div id="tab01"><p> </p><div class="jj"><p>Www.111cn.net</p></div><p class="pr">Webpage special effects</p><div><p>Webpage special effects</p></div><p>Website recording</p><div><p>Website recording</p></div><p class="box">Forum</p><div><p>Webmaster forum</p></div></div><div id="tab02"><p> </p><ol class="pr"> <li>Www.111cn.net</li></ol><p class="box">Webpage special effects</p><ol> <li>Webpage special effects</li></ol><p>Website recording</p><ol> <li>Website recording</li></ol><p class="bb">Webmaster forum</p><ol> <li>Webmaster forum</li></ol></div><div id="tab03"><p>Webmaster Sky</p><div class="tab"><p>Http://www.111cn.net</p></div><p>Webpage special effects</p><div class="tab wushi"><p>Webpage special effects</p></div><p>Website recording</p><div class="tab"><p>Website recording</p></div><p class="box">Webmaster forum</p><div class="tab tab123"><p>Webmaster forum</p></div></div><script type="text/javascript"><!--function Pid(id,tag){if(!tag){return document.getElementById(id);}else{return document.getElementById(id).getElementsByTagName(tag);}}function tab(id,hx,box,iClass,s,pr){var hxs=Pid(id,hx);var boxs=Pid(id,box);if(!iClass){ boxsClass=boxs; }else{var boxsClass = [];for(i=0;i<boxs.length;i++){if(boxs[i].className.match(/btabb/)){boxsClass.push(boxs[i]);}}}if(!pr){go_to(0);yy();}else {go_to(pr);yy();}function yy(){for(var i=0;i<pxs.length;i++){hxs[i].temp=i;if(!s){s="onmouseover"; hxs[i][s]=function(){go_to(this.temp);}}else{hxs[i][s]=function(){go_to(this.temp);}}}}function go_to(pr){for(var i=0;i<pxs.length;i++){if(!hxs[i].tmpClass){hxs[i].tmpClass=hxs[i].className+=" pr1984_com";boxsClass[i].tmpClass=boxsClass[i].className+=" pr1984_com";}if(pr==i){hxs[i].className+=" up"; boxsClass[i].className+=" up"; }else {hxs[i].className=hxs[i].tmpClass;boxsClass[i].className=boxsClass[i].tmpClass;}}}}tab("tab01","h3","div","","onclick",2); tab("tab02","h4","ol"); tab("tab03","h3","div","tab"); //--></script>
Tip: you can modify some code before running
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.