Javascript“图像流” IE 无法加载,在其他浏览器中加载缓慢
我正在使用名为 ImageFlow 的 JavaScript 脚本。它在 FF/Chrome 中运行良好,但速度非常慢且不稳定。
在 IE (9,8,7) 中它根本拒绝加载。没有 JS 问题,我无法发布代码,因为代码太多,而且我也没有对任何网站进行编码,所以不知道是什么触发了它出错。
演示站点为 http://crofts.propertylogic.net,图像流的 JS 可以在 http://crofts.propertylogic.net/coverflow/imageflow.js 。该效果旨在与团队成员一起插入页面中间的白色框中,正如您在 chrome/ff 上看到的那样。如果有人能指出我正确的方向,那就太好了。
I'm using a javascript script called ImageFlow. It runs fine in FF/Chrome, however is very slow and hangy.
In IE (9,8,7) it just refuses to load at all. There are no JS problems, and I can't post the code as there is too much and I also didnt code any of the site so dont know what triggered it to go wrong.
The demo site is http://crofts.propertylogic.net and the JS for the imageflow can be found at http://crofts.propertylogic.net/coverflow/imageflow.js . The effect is meant to slot into the white box in the middle of the page, with the team members, as you can see on chrome/ff. If anyone could point me in the right direction that would be great.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
我无法为您修复代码,但我可以基本上告诉您为什么它在 IE9 中不起作用。找到“myImageFlow”div 的 init 事件发生在该 div 被读入 DOM 之前。我相信这是因为 ImageFlow 插件模仿 IE 的 DOMContentLoaded 事件的方式。 ImageFlow 插件使用 DOMContentLoaded 插件 自 08 年 5 月以来就没有更新过。我敢打赌,这个库已经过时了,因此它破坏了 ImageFlow,而 ImageFlow 看起来也已经过时了。
老实说,我建议您寻找更现代的插件。如果这没有帮助,请尝试弄乱 DOMContentLoaded 部分,看看是否可以找出为什么它在 IE9 中延迟不够长(使用调试器 F12)。
I can't fix the code for you, but I can tell you basically why it isn't working in IE9. The init event that finds the 'myImageFlow' div is happening before that div has been read into the DOM. I believe it's because of the way the ImageFlow plugin imitates the DOMContentLoaded event for IE. The ImageFlow plugin uses the DOMContentLoaded plugin which hasn't been updated since May '08. I would bet you that library is out of date and as a result it is breaking ImageFlow, which also looks to be quite out of date.
I would honestly suggest that you look for a more modern plugin. If that doesn't help, try messing around with the DOMContentLoaded section to see if you can figure out why it is not delaying long enough in IE9 (use the debugger F12).
如果您没有对任何站点进行编码,那么您很可能也没有在该站点上安装 imageflow。但安装已经涵盖了,对吗?或者也许不是!
http://finnrudolph.de/ImageFlow/Installation
这意味着您必须将图像尺寸插入服务器端的 xhtml 中,我认为是这样。目前正在这样做吗?
If you didn't code any of the site, chances are you didn't install imageflow at the site either. But installation has been covered, right? Or maybe not!
http://finnrudolph.de/ImageFlow/Installation
That means would you have to insert the image dimensions into the xhtml at server side for ie I think. Is that currently being done?
在 IE8 上检查了网站,似乎动画位工作正常,只是图像看起来垂直拉伸。
Checked the website on IE8 and seems to be working fine with animation bit, only things i the Images looks stretched vertically.
你可以使用 jQuery 修复这个问题 - 一切都是正确的 dom 处理程序是问题所在。
you can fix this using jQuery - all are correct the dom handler is the issue.
我知道现在回答这个问题有点晚了。 InvisibleBacon 是正确的,因为 domReady 代码自 2008 年以来就没有被修改过,但我检查了 domReady 代码,它确实适用于 IE 5 到 11、Firefox、Chrome、Mobil Chrome、Safari 和 Mobile Safari。我没有用 Opera 检查代码。
在这种情况下,我想说问题出在您正在使用的 imageflow.js 代码上,我发现您不再使用它。
I know this is a little late to answer this question. InvisibleBacon is correct in that the domReady code hasn't been modified since 2008, but I checked the domReady code and it does work for IE 5 through 11, Firefox, Chrome, Mobil Chrome, Safari, and Mobile Safari. I did not check the code with Opera.
In this case I would say the problem is with the imageflow.js code you were using, which I see you no longer use.