Sliding door effect code

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

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><ptml xmlns="http://www.w3.org/1999/xhtml"><pead><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><title>Sliding door effect code 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">/* 13 Demon qq: 181097667msn: wl181907667@hotmail.com mailbox: thirdteendevil@163.com */function scrollDoor () {} scrollDoor. prototype = {sd: function (menus, divs, openClass, closeClass) {var _ this = this; if (menus. length! = Divs. length) {alert ("The number of menu layers is different from the number of content layers! "); 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></pead><body><div class="bodyer"> <p class="t_rt">Sliding door encapsulation</p> <p>Effect preview</p> <div class="preview"> <div class="scrolldoorFrame"> <ul class="scrollUl"> <li class="sd01" id="m01">Sliding Door</li> <li class="sd02" id="m02">Sliding Door</li> <li class="sd02" id="m03">Sliding Door</li> <li class="sd02" id="m04">Sliding Door</li> <li class="sd02" id="m05">Sliding Door</li> </ul> <div class="bor03 cont"> <div id="c01">First-level content</div> <div id="c02" class="hidden">Layer 2 content</div> <div id="c03" class="hidden">Layer 3 content</div> <div id="c04" class="hidden">Layer-4 content</div> <div id="c05" class="hidden">Layer 5 content</div> </div> </div> </div> <div class="preview"> <div class="scrolldoorFrame"> <ul class="scrollUl"> <li class="sd01" id="mm01">Sliding Door</li> <li class="sd02" id="mm02">Sliding Door</li> <li class="sd02" id="mm03">Sliding Door</li> <li class="sd02" id="mm04">Sliding Door</li> <li class="sd02" id="mm05">Sliding Door</li> </ul> <div class="bor03 cont"> <div id="cc01">First-level content</div> <div id="cc02" class="hidden">Layer 2 content</div> <div id="cc03" class="hidden">Layer 3 content</div> <div id="cc04" class="hidden">Layer-4 content</div> <div id="cc05" class="hidden">Layer 5 content</div> </div> </div> </div> <div class="preview"> <div class="scrolldoorFrame"> <ul class="scrollUl"> <li class="sd01" id="mmm01">Sliding Door</li> <li class="sd02" id="mmm02">Sliding Door</li> <li class="sd02" id="mmm03">Sliding Door</li> <li class="sd02" id="mmm04">Sliding Door</li> <li class="sd02" id="mmm05">Sliding Door</li> </ul> <div class="bor03 cont"> <div id="ccc01">First-level content</div> <div id="ccc02" class="hidden">Layer 2 content</div> <div id="ccc03" class="hidden">Layer 3 content</div> <div id="ccc04" class="hidden">Layer-4 content</div> <div id="ccc05" class="hidden">Layer 5 content</div> </div> </div> </div> </div></body></ptml>This code is provided by the webpage special effect network.
Tip: you can modify some code before running

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.