jquery animation fixed position -


bellow code contact form expands user clicks it

$(document).bind('click',             function() { $('div#contactable_inner').animate({"marginleft": "-=387px"}, "slow")             }); 

for each click, element moves -387px. want move -387px 1st click. next clicks, should not animate.

$(document).one('click',             function() { $('div#contactable_inner').animate({"marginleft": "-=387px"}, "slow")             }); 

.one() fires 1 time.

read .one()


Comments

Popular posts from this blog

How do you change vbulletin's home page to the forums instead of the default (CMS or Activity Stream)? -

c++ - Troubles when compiling phash program -