使用 JQuery Cycle 旋转背景 - 似乎会影响布局

发布于 2024-12-18 06:58:25 字数 165 浏览 1 评论 0原文

我尝试在我的网站中添加“更改背景”按钮,并决定使用 JQuery Cycle 插件。该循环运行良好,但背景不再位于我网站上所有内容的后面 - 相反,它位于所有内容的顶部。我没有更改 HTML 文件中元素的顺序,如果我从 $init 函数中删除创建循环的 JQuery 语句,背景将返回到它应该在的位置。有什么想法吗?

I tried to add in a "change background" button to my site and decided to use the JQuery Cycle plugin. The cycle is working fine, but the background is no longer sitting behind all the content on my site - instead, it's sitting on top of everything. I haven't changed the order of the elements in my HTML file, and if I remove the JQuery statement that creates the cycle from the $init function, the background goes back to where it should. Any ideas?

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

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

发布评论

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

评论(1

○愚か者の日 2024-12-25 06:58:25

jQuery Cycle 插件操作其幻灯片的 z-index。最有可能的是,比其他内容更高的 z-index 被分配给一张或多张背景图像,因此该幻灯片(或多张幻灯片)显示在其他内容之上。

您可以使用 Firebug 等工具或 Chrome 或 Safari 中的本机开发人员工具来检查图像,从而观察到这一点由 Cycle 插件旋转。

The jQuery Cycle plugin manipulates the z-index of its slides. Most likely, a z-index higher than that of your other content is being assigned to one or more of the background images and, therefore, that slide (or slides) is displayed above the other content.

You can observe this by using a tool like Firebug or the native Developer tools in Chrome or Safari to inspect the images while they're being rotated by the Cycle plugin.

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