javascript - How to transition element when changing its relative top? -
in jquery change elements position (which has relative positioning) $(elem).css("top",x);
. how can , animate or transition it, moves new location fast not instantly.
thanks.
two ways :
1 . can use jquery animate()
:
demo : http://jsfiddle.net/5pvww/
learn more jquery animate()
function here .
2 . can use css transition
:
demo : http://jsfiddle.net/eebdh/
learn more transition
in tutorial .
Comments
Post a Comment