Click the drop-down menu in jQuery to display a small example.

Source: Internet
Author: User

Copy codeThe Code is as follows:
<Title> navigation-click the pop-up content </title>
<Style type = "text/css">
. Navgation {margin: 0; padding: 0; list-style-type: none; position: relative ;}
. Navgation li {float: left ;}
. Navgation a {padding: 3px 6px; background-color: orange; color: white; text-decoration: none; float: left; height: 24px ;}
. Navgation a: hover {background-color: white; color: blue; text-decoration: underline ;}
. Navgation div {display: none; position: absolute; top: 30px ;}
</Style>
<Script src = "Jquery1.7.js" type = "text/javascript"> </script>
<Script type = "text/javascript">
$ (Document). ready (function (){
$ (". Navgation input"). each (function (){
Var this_div = $ (". navgation div ");
Var _ parameters = $ (". navgation input"). index (this );
$ (This). click (
Function () {this_div.eq (_ signature). slideToggle ();},
Function () {this_div.eq (_ signature). slideToggle ();}
);
});
});
</Script>
</Head>
<Body>
<Form id = "form1" runat = "server">
<Div>
<Ul class = "navgation">
<Li> <input type = "button" id = "button" value = "link 1"/>
<Div> put down the pull content 1 </div>
</Li>
<Li> <input type = "button" id = "button1" value = "link 2"/>
<Div> put down the pull content 2 </div>
</Li>
<Li> <input type = "button" id = "button2" value = "link 3"/>
<Div> put down the pull content 3 </div>
</Li>
<Li> <input type = "button" id = "button3" value = "Link 4"/>
<Div> put down the pull content 4 here </div>
</Li>
<Li> <input type = "button" id = "button4" value = "link 5"/>
<Div> put down the pull content 5 </div>
</Li>
</Ul>
</Div>
</Form>
</Body>

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.