jQuery 中的动画伪类
是否可以在激活伪类时对其进行动画处理,例如:
我必须在我的 css 中执行以下操作:
#gallery a span {
border:#006553 3px solid;
position:relative;
overflow:hidden;
display:block;
top:0px;
left:0px;
height:89px;
width:89px;
}
#gallery a:hover span {
border:#f3bd2f 6px solid;
position:relative;
overflow:hidden;
display:block;
top:0px;
left:0px;
height:83px;
width:83px;
}
我想在用户将鼠标悬停在链接上时对转换进行动画处理,即跨度边框必须增大。
如果这可能的话有人吗?
提前致谢。
// 编辑:
我查看了 'animateToSelector' jQuery 插件,并使用了以下 jQuery 函数调用,但没有动画,边框只是在上面指定的样式之间跳转。
这是我的函数调用:
$("#gallery a span").animateToSelector({selectors: ["#gallery a:hover span"], properties: ['border'], events: ['mouseover','mouseout'], duration: 3000});
任何人都可以看到我丢失的东西吗?
Is it possible to animate a pseudo class when it is activated, for example:
I have to the following in my css:
#gallery a span {
border:#006553 3px solid;
position:relative;
overflow:hidden;
display:block;
top:0px;
left:0px;
height:89px;
width:89px;
}
#gallery a:hover span {
border:#f3bd2f 6px solid;
position:relative;
overflow:hidden;
display:block;
top:0px;
left:0px;
height:83px;
width:83px;
}
I want to animate the transformation when a user hovers over the link, i.e. the span border must grow.
Does anyone if this is possible?
Thanks in advance.
// edit:
I have looked at the 'animateToSelector' jQuery Plug-in, and used the following jQuery function call, but there is no animation, the border just jumps between the specified styles above.
Here is my function call:
$("#gallery a span").animateToSelector({selectors: ["#gallery a:hover span"], properties: ['border'], events: ['mouseover','mouseout'], duration: 3000});
Can anyone see something I'm missing?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
jQuery UI 提供了这样一个函数 它将把一个元素从一个类动画到另一个类
jQuery UI provides such a function which will animate an element from one class to another
为什么不直接在鼠标悬停时绑定动画?
why not just bind the animation on mouseover ?