jquery - sliding panel open/close on click -
how can have have sliding panel function "on click" instead of mouseover/mouseout
<script> $("button.main").mouseover(function() { $("div.sliderinner").animate( {"width": "100px"}, "500"); }); $("button.main").mouseout(function() { $("div.sliderinner").animate( {"width": "0px"}, "700"); }); $("button.main").mouseover(function() { $("div.sliderinner") .html('example content'); }); $("button.main").mouseout(function() { $("div.sliderinner") .html(''); }); </script>
thank you
instead of mouseover .toggle , supply number of functions want toggle through including slideinner
$(#buttonmain).toggle(function () { $('div.sliderinner').animate( {"width": "100px"}, "500"); }, function () { //animate next click });
the clicks cycle through functions
Comments
Post a Comment