JQuery transition from X,Y to X,Y positions
I have some div which start from X,Y coordi开发者_JAVA百科nates to new X,Y coordinates. Actually I use .css() to set the new coordinates but I want to add a transitional effect.
Anyone have an idea ?
Thanks
You can use animate method of jquery. You have documentation and examples here: http://api.jquery.com/animate/
$('#your-element').animate({ top: '20px', left: '50px' }, 1000);
精彩评论