Lee*_*Lee 0 javascript css jquery jquery-animate
你将如何设置position:relative中的元素属性,它不具有初始position属性集,内jQuery的animate()?
这不起作用:
$(mLinks[id]).animate
(
{
position:'relative',
left:'200px'
}
);
Run Code Online (Sandbox Code Playgroud)
鉴于这mLinks是一个有效的DOM元素对象.
我也试过duration和callback参数.
"动画"css position属性是没有意义的不是吗?有没有之间的relative和absolute或static之类的东西......
这就是我要做的:
$(mLinks[id]).css('position', 'relative').animate
(
{
left:'200px'
}
);
Run Code Online (Sandbox Code Playgroud)
如果你阅读了相应的jQuery文档,你会发现:
most properties that are non-numeric cannot be animated using basic jQuery functionality (For example, width, height, or left can be animated but background-color cannot be, unless the jQuery.Color() plugin is used).
| 归档时间: |
|
| 查看次数: |
7788 次 |
| 最近记录: |