将 jQuery Slideshowlite 与基于 DNN 的网站一起使用时的图像问题
基本上,当页面打开时,幻灯片中包含的图像在正确放置到幻灯片中之前会暂时堆叠。
我认为这可能是因为 DNN 在运行脚本文件之前首先渲染位于 HTML 中的图像。这会导致图像列表(它们位于
我尝试过的事情:
- 将调用幻灯片的脚本放在 HTML 的末尾(有人建议这样做,但不知道为什么它会起作用)。
- 最初隐藏包含图像的 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:
- placing the script which calls the slideshow at the end of the HTML (Someone suggested this, no idea why it would work though).
- 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
策略#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.