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

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -