Jquery 生活元素

发布于 2024-09-03 12:22:36 字数 188 浏览 1 评论 0原文

有谁知道如何处理 http://2crossmedia.com/liv-multicolor/ 如果您单击文本字段,它会被一条变色线包围。 代码说它是jquery。但如何:)?

非常感谢!

Does anybody know how to deal with the effect at http://2crossmedia.com/liv-multicolor/
If you click into the text field, its surrounded by a color-changing line.
The code says it's jquery. But how :) ?

A lot of thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

相权↑美人 2024-09-10 12:22:36

太酷了。它使用 3 个图像:

蒙版是一个半透明的 png,其中渐变通过的部分是透明的。所以它们只是在蒙版后面的渐变中淡出。然后他们只需使用超时来平移它。类似于:

<div id="bg"></div>
<div id="gradient"></div>
<div id="front"></div>

#gradientopacity = 0 开头。然后你执行如下操作:$("#gradient").fadeIn()

That's pretty cool. It uses 3 images:

The mask is a semi-transparent png with transparent parts where the gradient comes through. So they just fade in the gradient behind the mask. Then they just pan it using a timeout. Something like:

<div id="bg"></div>
<div id="gradient"></div>
<div id="front"></div>

#gradient starts out with opacity = 0. Then you do something like: $("#gradient").fadeIn().

司马昭之心 2024-09-10 12:22:36

如果您使用 firebug 查看脚本的源代码,您可以看到它们正在为背景图像设置动画。图像是多色的,并且比显示屏更宽。他们正在改变图像的位置,给人一种颜色正在褪色的错觉。
这是他们正在使用的图像

If you view the source of the scripts using firebug, you can see that they are animating the background image. The image is mulicolor, and wider than the display. They are changing the position of the image to give it the illusion that it is fading colors.
Here's the image they are using.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文