jQuery 多背景脚本在 IE 中不起作用

发布于 2024-10-21 20:16:53 字数 422 浏览 6 评论 0原文

我正在使用 http:// www.chicowebdesign.com/blog/2010/10/21/updated-jquery-multiple-background-plug-in/

正如他们所说,但在 IE 中,多个背景不起作用,有什么想法、建议吗?

http://jsfiddle.net/6JtNr/ (只是我使用的CSS)

我包括jQuery,包括加载 jquery 后他们的脚本..

有想法吗?

I'm using http://www.chicowebdesign.com/blog/2010/10/21/updated-jquery-multiple-background-plug-in/

As they state to, but in IE the multiple backgrounds do not work, any ideas, suggestions?

http://jsfiddle.net/6JtNr/ (just the css im using)

I'm including jQuery, including their script after jquery is loaded..

Ideas?

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

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

发布评论

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

评论(1

伴梦长久 2024-10-28 20:16:53

据我了解,阅读页面上的说明,您需要将 css 更改为:
<代码>

.container {
    /* For unsupported browsers /
    background: url('../images/backgrounds/fifteen.jpg') no-repeat 13440px 0;
    / For CSS3 Supported Browsers */
    background: url('../images/backgrounds/one.jpg') no-repeat top 0,
    url('../images/backgrounds/two.jpg') no-repeat 960px 0,
    url('../images/backgrounds/three.jpg') no-repeat 1920px 0,
    url('../images/backgrounds/four.jpg') no-repeat 2880px 0,
    url('../images/backgrounds/five.jpg') no-repeat 3840px 0,
    url('../images/backgrounds/six.jpg') no-repeat 4800px 0,
    url('../images/backgrounds/seven.jpg') no-repeat 5760px 0,
    url('../images/backgrounds/eight.jpg') no-repeat 6720px 0,
    url('../images/backgrounds/nine.jpg') no-repeat 7680px 0,
    url('../images/backgrounds/ten.jpg') no-repeat 8640px 0,
    url('../images/backgrounds/eleven.jpg') no-repeat 9600px 0,
    url('../images/backgrounds/twelve.jpg') no-repeat 10560px 0,
    url('../images/backgrounds/thirteen.jpg') no-repeat 11520px 0,
    url('../images/backgrounds/fourteen.jpg') no-repeat 12480px 0,
    url('../images/backgrounds/fifteen.jpg') no-repeat 13440px 0;
    width: 14400px;
    height: 1020px;
}

请注意,我将宽度和高度移至底部,有些人在该库的评论中说背景需要位于样式标签的第一位。此外,根据说明,您需要有一个单独的背景行来调用不支持的浏览器的最后一个背景图像。

From what I understand, reading the instructions on the page, you need to change your css to:

.container {
    /* For unsupported browsers /
    background: url('../images/backgrounds/fifteen.jpg') no-repeat 13440px 0;
    / For CSS3 Supported Browsers */
    background: url('../images/backgrounds/one.jpg') no-repeat top 0,
    url('../images/backgrounds/two.jpg') no-repeat 960px 0,
    url('../images/backgrounds/three.jpg') no-repeat 1920px 0,
    url('../images/backgrounds/four.jpg') no-repeat 2880px 0,
    url('../images/backgrounds/five.jpg') no-repeat 3840px 0,
    url('../images/backgrounds/six.jpg') no-repeat 4800px 0,
    url('../images/backgrounds/seven.jpg') no-repeat 5760px 0,
    url('../images/backgrounds/eight.jpg') no-repeat 6720px 0,
    url('../images/backgrounds/nine.jpg') no-repeat 7680px 0,
    url('../images/backgrounds/ten.jpg') no-repeat 8640px 0,
    url('../images/backgrounds/eleven.jpg') no-repeat 9600px 0,
    url('../images/backgrounds/twelve.jpg') no-repeat 10560px 0,
    url('../images/backgrounds/thirteen.jpg') no-repeat 11520px 0,
    url('../images/backgrounds/fourteen.jpg') no-repeat 12480px 0,
    url('../images/backgrounds/fifteen.jpg') no-repeat 13440px 0;
    width: 14400px;
    height: 1020px;
}

Note that I moved the width and height to the bottom, some people said in the comments of that library that the background needs to be first in the style tag. Also, as per the instructions, you need to have a separate background line calling the last background image for unsupported browsers.

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