Native JS code horizontal navigation Bar effect

Source: Internet
Author: User

<!     DOCTYPE html>/*label and text combined with area effect making: 1. Use UL to classify label 2. The UL display is defined as block to combine the UL area with the following Div area 3. Define a bottom border for UL or define a top border for the Div content area     4. All Li tags default style does not have a border, as the active display of the Li label widened its #fff (white) area of the lower border, overlay. */*{margin:0px; padding:0px; font:12px normal; font-family: Microsoft ya black; } #tabs {width:290px; height:150px; padding:5px; margin:20px;} #tabs ul{list-style:none; Display:block; height:30px; line-height:30px;} #tabs ul li{float: Left; width:60px; height:28px; line-height:28px; text-Align:center; Display:inline-block;margin:0px 3px; border:1px solid #aaa; border-Bottom:none; Cursor:pointer; Background: #fff; List-Style:none;} #tabs ul li.on{Border-top:2px solid SaddleBrown; border-bottom:2px solid #fff;} #tabs div{height:120px;-height:25px; border:1px solid #336699; border-top:2px saddlebrown solid;padding:5px;}    . Hide{display:none;} </style> <script type= "Text/javascript" >window.onload=function(){        varOtab = document.getElementById ("tabs")        varLi = document.getElementsByTagName ("li"); vardiv = otab.getelementsbytagname ("div");//Otabs.get ... is to define the ClassName action object for all text div under ID tabs                 for(vari=0;i<li.length;i++) {//get all I-numbered elementsLi[i].index = i;//define an Index property to number LiLi[i].onclick =function(){//then register a click event and all tabs are restored to their original state when clicked             for(varn=0;n<li.length;n++) {//This step is relative to the not clicked part of the styleLi[n].classname = ""; Div[n].classname= "Hide"; }             This. ClassName = "on";//then add the corresponding properties to the Click eventdiv[ This. Index].classname = "";//the specified div that is bound by the previous index number            }        }    }        </script> 2.75 million purchase Changping Neighborhood Triathlon Total Price 200,000 buy a home<br>2 million within the five rings of the three 1.4 million home to the east third ring<br>Beijing 0 First pay property 530,000 buy East 5 ring 50 Ping<br>Beijing Real estate straight down 5000 Citic House Park house Wang existing<br> </div> <div class= "Hide" >40 Flat rental house big makeover beauty girl's mixed up small nest<br>Classic Fresh Jean Home 90 flat old room glow Renaissance<br>new Chinese cool color warmth 66 Flat contrast lively home<br>tiles are like choosing a wife. Design of the flue in the bathroom<br> </div> <div class= "Hide" >Tongzhou luxury 3 2,600,002 ring scarce 2 250w dump<br>West 3-ring permeability 2 29,001,300,002-bedroom Limited<br>Yellow Cheng Gen Elementary School District only 2,600,121 flat 700,000 throw!<br>exclusive villa 2.8 million Suzhou Bridge 2 special price 2.48 million<br> </div></div> </body>

Native JS code horizontal navigation Bar effect

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.