jquery implementation of the background system left menu click expand/Shrink Level two menu effect

Source: Internet
Author: User

Html:

<divclass="col-sm-3 col-md-2 Sidebar"> <divclass="Totalt"><a> Systems Management Systems </a></div> <ulclass="Menu"> <liclass="title"> <aclass="Item Item1"><spanclass="Glyphicon Glyphicon-chevron-down Myarrow"></span>Account Management</a> <ulclass="content"> <li> <aclass="Item ITEM2"href="right5.html"target=" Right"><spanclass="Glyphicon Glyphicon-step-backward"></span>Account Management</a> </li> <li> <aclass="Item ITEM2"href="right.html"target=" Right"><spanclass="Glyphicon Glyphicon-step-backward"></span>Account Management</a></li> <li> <aclass="Item ITEM2"href="right2.html"target=" Right"><spanclass="Glyphicon Glyphicon-step-backward"></span>Account Management</a></li> </ul> </li> <liclass="title"> <aclass="Item Item1"><spanclass="Glyphicon Glyphicon-chevron-down Myarrow"></span>Account Management</a> <ulclass="content"> <li> <aclass="Item ITEM2"href="#"><spanclass="Glyphicon Glyphicon-step-backward"></span>Account Management</a> </li> <li> <aclass="Item ITEM2"href="#"><spanclass="Glyphicon Glyphicon-step-backward"></span>Account Management</a></li> <li> <aclass="Item ITEM2"href="#"><spanclass="Glyphicon Glyphicon-step-backward"></span>Account Management</a></li> </ul> </li> <liclass="title"> <aclass="Item Item1"><spanclass="Glyphicon Glyphicon-chevron-down Myarrow"></span>Account Management</a> <ulclass="content"> <li> <aclass="Item ITEM2"href="#"> <spanclass="Glyphicon Glyphicon-step-backward"></span>Account Management</a> </li> <li> <aclass="Item ITEM2"href="#"><spanclass="Glyphicon Glyphicon-step-backward"></span>Account Management</a></li> <li> <aclass="Item ITEM2"href="#"><spanclass="Glyphicon Glyphicon-step-backward"></span>Account Management</a></li> </ul> </li> </ul></div>

Js:

$(". title. Item1"). Click (function () {$ ( This). Next (". Content"). Slidetoggle ();//implementation of the two-level menu expansion shrink function $ ( This). Find ("span"). Toggleclass ("Glyphicon Glyphicon-chevron-down");//The conversion effect of the icon when the menu click is realized $ ( This). Find ("span"). Toggleclass ("Glyphicon glyphicon-chevron-right");})

CSS is not posted, using jquery to achieve this vertical accordion menu is really much easier.

jquery implementation of the background system left menu click expand/Shrink Level two menu 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.