Download the folding menu source code and HTML5 source code based on html5 code.

Source: Internet
Author: User

Download the folding menu source code and HTML5 source code based on html5 code.
Download the folding menu with source code based on html5 code. The effects are lifelike and easy to use. If you are interested in the html5 folding menu, refer

Download the folding menu with source code based on html5 code. As shown in the following figure, you can download the source code!

Download the effect display source code

Hmtl code:


The Code is as follows:
<Div class = "container">
<Div class = "card-drop">
<A class = 'toggle 'href = "#">
<I class = 'fa fa-suitcase'> </I>
<Span class = 'label-active'> love programming </span>
</A>
<Ul>
<Li class = 'active'>
<A data-label = "Everyting" href = "#"> <I class = 'fa fa-suitcase'> </I> love programming </a>
</Li>
<Li>
<A data-label = "Design" href = "#"> <I class = 'fa fa-magic '> </I> jQuery effect </a>
</Li>
<Li>
<A data-label = "UI-UX" href = "#"> <I class = 'fa fa-bolt '> </I> CSS3 effects </a>
</Li>
<Li>
<A data-label = "Print" href = "#"> <I class = 'fa fa-tint'> </I> HTML5 effects </a>
</Li>
<Li>
<A data-label = "Photography" href = "#"> <I class = 'fa fa-camera-retro '> </I> download sound effects </a>
</Li>
<Li>
<A data-label = "Photography" href = "#"> <I class = 'fa fa-camera-retro '> </I> flash Animation </a>
</Li>
</Ul>
</Div>
</Div>

Js Code:


The Code is as follows:
(Function ($ ){
Var cards = $ ('. card-drop '), toggler = cards. find ('. toggle '), links = cards. find ('ul> li> A'), li = links. parent ('lil'), count = links. length, width = 100;
Li. each (function (I ){
((This).css ('z-Index', count-I );
});
Function setClosed (){
Li. each (function (index ){
Optional (this).css ('top', index * 42.16.css ('width', width-index * 0.5 + 'margin '0000.css ('margin-left', index * 0.25 + '% ');
});
Li. addClass ('closed ');
Toggler. removeClass ('active ');
}
SetClosed ();
Toggler. on ('mousedown ', function (){
Var $ this = $ (this );
If ($ this. is ('. activity ')){
SetClosed ();
} Else {
$ This. addClass ('active ');
Li. removeClass ('closed ');
Li. each (function (index ){
Optional (this).css ('top', 60 * (index + 1)).css ('width', '100%'}.css ('margin-left', '0px ');
});
}
});
Links. on ('click', function (e ){
Var $ this = $ (this), label = $ this. data ('label ');
Icon = $ this. children ('I'). attr ('class ');
Li. removeClass ('active ');
If ($ this. parent ('lil'). is ('activity ')){
$ This. parent ('lil'). removeClass ('active ');
} Else {
$ This. parent ('lil'). addClass ('active ');
}
Toggler. children ('span '). text (label );
Toggler. children ('I'). removeClass (). addClass (icon );
SetClosed ();
E. preventDefault;
});
} (JQuery ));

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.