将 jQuery Slideshowlite 与基于 DNN 的网站一起使用时的图像问题

发布于 2024-10-06 18:06:52 字数 426 浏览 1 评论 0原文

基本上,当页面打开时,幻灯片中包含的图像在正确放置到幻灯片中之前会暂时堆叠。

我认为这可能是因为 DNN 在运行脚本文件之前首先渲染位于 HTML 中的图像。这会导致图像列表(它们位于

  • 标签中)一个一个地放置在另一个之上(大约 2 秒),然后才正常运行。
  • 我尝试过的事情:

    1. 将调用幻灯片的脚本放在 HTML 的末尾(有人建议这样做,但不知道为什么它会起作用)。
    2. 最初隐藏包含图像的 div,然后使用脚本在文档加载后使用 jquery 和 css 显示 div。 (例如:display: none >> display: block)

    对于那些感兴趣的人来说,这里有一个指向该网站的链接(使用 Bitly): http://bit.ly/gNfWRx

    非常感谢

    彼得

    Basically, when the page opens, the images contained within the slideshow are temporarily stacked before being placed correctly into the slideshow.

    I think this might be because DNN renders the images located in the HTML first before it runs through the script files. This results in a list of images (they're in < li > tags) placed one over the other (for about 2 seconds), before behaving normally.

    Things Iv tried:

    1. placing the script which calls the slideshow at the end of the HTML (Someone suggested this, no idea why it would work though).
    2. hiding the div containing the images initially and then use a script that reveals the div using jquery and css once the document has loaded. (eg: display: none >>> display: block)

    for those interested here's a link to the site (uses Bitly):
    http ://bit.ly/gNfWRx

    Much appreciated

    Peter

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

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

    发布评论

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

    评论(1

    太阳哥哥 2024-10-13 18:06:52

    策略#2 应该有效。如果您在当前的 div / li 项目周围放置一个 div 并使其显示:无或更改可见性。然后在运行幻灯片初始化后的 jQuery document.ready 中,您将执行一些 jQuery 来查找该 div,然后 show() 它。可能需要做一些工作,但该策略应该会很好地发挥作用。

    Strategy #2 should work. If you put a div around your current div / li items and you make that display:none or change the visibility. Then in your jQuery document.ready after the slideshow initialization in run you would execute some jQuery to find that div and then show() it. Might take a little work but that strategy should work just fine.

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