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 ));