javascript - jQuery help wanted ... -


i have site there pop window in right. , have button. query , if click button pop windows come left , if again click button pop window go it's previous place mean right. it's slidetoggle . have try . comes left it's not going . how ?

<script> function goto(){         //animate div id.     $(".pop_up").animate({"left": -($(id).position().left)});  } $(document).ready(function(){   $(".red_sec").click(function(){     $(".pop_up").animate({left:'-560px'});   }); }); </script> 

sorry bad english skill .

thanks

try code, give toggle effect.

$(document).ready(function(){   $(".red_sec").click(function(){        $(".pop_up").animate({'left': ($(".pop_up").position().left == -560)?100:-560});   }); }); 

fiddle


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -