创建 Google 风格的背景图像推子?

发布于 2024-09-05 22:15:28 字数 90 浏览 1 评论 0原文

嘿伙计们。如果您还没有看到,Google 可以添加自定义背景图像(无论好坏),我想知道如何使用 jQuery 实现相同的淡入加载效果。

有什么想法吗?

Hey guys. If you haven't already seen, Google has the ability to add a custom background image (for better or worse) and I was wondering how to achieve the same fade-in-on-load effect using jQuery.

Any ideas?

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

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

发布评论

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

评论(2

胡渣熟男 2024-09-12 22:15:29

真正的问题是他们如何在调整浏览器大小时调整图像大小......淡入很容易:)
您还可以执行 $("#selectdiv").hide().animate({opacity : 1});

我认为淡入只是一个捷径

The real question is how do they resize the image on resizing the browser ... fading it in is easy :)
you can also do $("#selectdiv").hide().animate({opacity : 1});

I think fadeIn is just a shortcut to that annyway

痴梦一场 2024-09-12 22:15:28

jQuery 有一个用于此目的的方法,fadeIn。请参阅文档了解说明。

.fadeIn([持续时间],[回调])

duration确定的字符串或数字
动画将运行多长时间。

回调函数调用一次
动画完成。

顺便说一句,淡入淡出通常被实现为使用 javaScript 来不断修改图像的不透明度元素。

jQuery has a method for this purpose, fadeIn. See documentation for explanation.

.fadeIn( [ duration ], [ callback ] )

durationA string or number determining
how long the animation will run.

callbackA function to call once the
animation is complete.

As an aside, fade is often implemented to use javaScript to continually modify the opacity of an element.

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