jquery - Collapse effect toogle -


i have little toggle script navbar. how can add animate effect?

this script.

$(document).ready(function(){     $("button").click(function(){         $(".collapse").toggleclass(".collapse in");     }); }); 

and css

.collapse {   display: none;   visibility: hidden; } .collapse.in {   display: block;   visibility: visible; } 

you use opacity of element css:

.collapse {     opacity:0;     transition: opacity 1s linear; } .collapse.in {     opacity:1; } 

see this jsfiddle


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -