Jquery Side Panel (click to close) -
as can see, there slide panel using jquery animated hover function. so, i'd have clcik function open , close panel. if replace "hover" "click" in code below, panel opens don't know how make closing... panel stays open...
` jquery(document).ready(function() { $('#slide').hover(function () { $(this).animate({left:"-25px"},500); },function () { var width = $(this).width() -50; $(this).animate({left: - width },500); }); }); `
(you can see working on www.zonevolley.com)
try this
var sliderisopen = false; $(document).ready(function() { $('#slide').click(function () { if (sliderisopen == false) { $(this).animate({left:"-25px"},500); sliderisopen = true; } else { var width = $(this).width() -50; $(this).animate({left: - width },500); sliderisopen = false; } }); });
Comments
Post a Comment