使用 JQuery 淡出加载中的平铺背景图像

发布于 2024-09-06 02:34:05 字数 255 浏览 6 评论 0原文

我过去曾使用 JQuery 成功地淡入和淡出 div。然而,我遇到了一种我无法完全理解的情况:

我正在为一位设计师编写一个网站,他将所有元素的格式基于他创建的网格图案。由于他希望图案元素的大小与浏览器窗口无关,因此我认为我只能通过 CSS 中的重复背景平铺图像来实现此目的。

现在,他希望背景图案(仅)变暗并逐渐变浅,同时不影响任何其他元素。

我是否认为不可能使用 CSS 选择器调用平铺背景图案?

有人对解决这个问题有任何建议吗?

I've used JQuery in the past to fade divs in and out successfully. However, I have encountered a situation I can't quite wrap my head around:

I am coding a site for a designer who has based the formatting of all the elements on a grid pattern he's created. As he wants the pattern elements to be the same size independent of the browser window, I think I can only do this via a repeating background tiled image in CSS.

Now he wants the background pattern (only) to come in dark and fade to very light, while not effecting any of the other elements.

Am I right in thinking it's impossible to call a tiled background pattern using a CSS selector?

Does anyone have any suggestions of a workaround to this problem?

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

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

发布评论

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

评论(1

错爱 2024-09-13 02:34:05

如果您有一个绝对定位的 div,并且其他所有内容都位于其之上,则您可以根据需要淡入和淡出该 div。

您还可以尝试在 CSS 中放置不透明滤镜以使其淡入淡出,虽然不是完全相同的东西,但概念相似。您必须针对不同的浏览器使用几种不同的方法。

If you have an absolute positioned div, with everything else on top of it, you can fade that div in and out all you want.

You can also try placing with opacity filters in CSS to fade it in an out, not quite the same thing but a similar concept. You'll have to use a few different methods for different browsers.

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