悬停时,延迟切换序列
每个人!我不太擅长 JS/JQuery,所以我在这里需要一些帮助...
我有一个垂直和水平居中的页面。在此页面中,我有一系列同心圆,中心有一个按钮。
我想要完成的任务如下:
- 页面加载所有圆圈 隐藏(用 css 很容易完成 显示:无;)
- 当“按钮”在 中心悬停在上面,我想要 淡入的圆圈 - 按顺序 从最小到最大
- 当 “按钮”已移出,我想要 淡出的圆圈 - 按顺序 最大到最小
所有圆圈都是单独的 DIV 元素,从不相互重叠。
请随时检查代码,如果有解决方案,请编辑它。
感谢任何有帮助的人!
屏幕截图:http://cl.ly/6CJR
请在Webkit中查看!
everyone! I'm not very good with JS/JQuery, so I need some help here...
I have a page both vertically and horizontally centered. In this page I have a series of concentric circles, with a button in the centre.
What I want to accomplish is the following:
- The page loads with all circles
hidden (easily done with css
display:none;) - When the 'button' in
the centre is hovered over, I want
the circles to fade in - in order
from smallest to largest - When the
'button' is moused out, I want the
circles to fade out - in order from
largest to smallest
All of the circles are separate DIV elements, never overlapping each other.
Please feel free to check the code, and edit it if you have a solution.
Thanks, to anyone that helps!
Screenshot: http://cl.ly/6CJR
ALL CODE: http://cssdesk.com/cNeCx
Please view in Webkit!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
可能有一种更简洁的方法来使用 jQuery 编写
setTimeout
调用,但这可行。演示: http://jsfiddle.net/mattball/xkLgf/
There's probably a cleaner way to write the
setTimeout
calls using jQuery, but this works.Demo: http://jsfiddle.net/mattball/xkLgf/
Fin.
查看 fadeIn() 文档。您可以传递一个附加参数,该参数是称为动画完成的函数。然后你可以连锁效应,如下所示:
Take a look at the fadeIn() docs. You can pass an additional parameter which is function called completion of the animation. You can then chain effects as in: