开发者

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);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜