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
Post a Comment