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

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

IIS->Tomcat Redirect: multiple worker with default -