开发者

JQuery transition from X,Y to X,Y positions

开发者 https://www.devze.com 2023-02-20 08:33 出处:网络
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.

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

精彩评论

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