使用 JQuery 淡出加载中的平铺背景图像
我过去曾使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您有一个绝对定位的 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.