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

Popular posts from this blog

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -