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
Post a Comment