如何创建进度“栏”类似于 Groovshark?
我很好奇...我该如何创建一个像 Grooveshark 以前那样的自定义进度条?如果您查看下图,您会发现进度条是鲨鱼形状的图像,并在页面加载时填充。
我认为这非常酷,并且很想知道它是如何完成的。这可以通过编程方式完成,还是在闪存中完成?如果可能的话,我真的很想用 JavaScript (jQuery) 来做到这一点。我从哪里开始/如何开始?
谢谢, 赫里斯托
I'm curious... how would I go about creating a custom progress bar like the one Grooveshark used to have? If you look at the image below, the progress bar is an image in the shape of a shark and fills in as the page loads.
I think this is very cool and would love to know how it is done. Can this be done programmatically, or is it done in flash? I would really like to do this in JavaScript (jQuery) if it is possible. Where/How do I start?
Thanks,
Hristo
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
图像中包含鲨鱼的部分可以是剪掉鲨鱼形状的 PNG。在其下方放置一个元素(通过 z-index),并对它的宽度进行动画处理,会给人一种鲨鱼填充的印象。
我成功地只使用图像来完成类似的事情,并对其背景图像进行动画处理:< a href="http://jsbin.com/imibe3">http://jsbin.com/imibe3
HTML
CSS
jQuery/Javascript
The portion of the image containing the shark could be a PNG with the shark shape cut out. Placing an element just beneath this (via z-index), and animating the width of it it will give the impression of the shark filling in.
I managed to accomplish something similar using nothing more than an image, and animating its background image: http://jsbin.com/imibe3
HTML
CSS
jQuery/Javascript