Javascript“图像流” IE 无法加载,在其他浏览器中加载缓慢

发布于 2024-12-08 11:02:00 字数 545 浏览 1 评论 0原文

我正在使用名为 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 技术交流群。

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

发布评论

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

评论(5

不羁少年 2024-12-15 11:02:01

我无法为您修复代码,但我可以基本上告诉您为什么它在 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).

最好是你 2024-12-15 11:02:01

如果您没有对任何站点进行编码,那么您很可能也没有在该站点上安装 imageflow。但安装已经涵盖了,对吗?或者也许不是!

http://finnrudolph.de/ImageFlow/Installation

<div id="unique_name" class="imageflow"> 
    <img src="dir/image_1.jpg" longdesc="URL_1" width="w_1" height="h_1" alt="Text_1" />
</div>

图像宽度和高度参数(w_x 和 h_x)必须在 XHTML 中设置,以便与 Internet Explorer 完全兼容。抱歉
这种额外的工作负担 - 除 Microsoft Internet 之外的所有浏览器
Explorer 可以通过 JavaScript 获取正确的图像尺寸!

这意味着您必须将图像尺寸插入服务器端的 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

<div id="unique_name" class="imageflow"> 
    <img src="dir/image_1.jpg" longdesc="URL_1" width="w_1" height="h_1" alt="Text_1" />
</div>

The image width and height parameters (w_x and h_x) must be set in the XHTML for full compatibility with the Internet Explorer. Sorry for
this extra load of work - every browser but Microsofts Internet
Explorer can fetch the right image dimensions via the JavaScript!

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?

悲念泪 2024-12-15 11:02:01

在 IE8 上检查了网站,似乎动画位工作正常,只是图像看起来垂直拉伸。

Checked the website on IE8 and seems to be working fine with animation bit, only things i the Images looks stretched vertically.

平定天下 2024-12-15 11:02:01

你可以使用 jQuery 修复这个问题 - 一切都是正确的 dom 处理程序是问题所在。

$(document).ready() is the key

$(document).ready(function()
{
    var circular_3 = new ImageFlow();
    circular_3.init({ ImageFlowID: 'imageflow1',
        //circular: true,
        reflections: false,
        reflectionP: 0.4,
        slider: false,
        captions: false,
        opacity: true,
        xStep: 250,
        imageFocusM: 1.5,
        startID: 2
    });

you can fix this using jQuery - all are correct the dom handler is the issue.

$(document).ready() is the key

$(document).ready(function()
{
    var circular_3 = new ImageFlow();
    circular_3.init({ ImageFlowID: 'imageflow1',
        //circular: true,
        reflections: false,
        reflectionP: 0.4,
        slider: false,
        captions: false,
        opacity: true,
        xStep: 250,
        imageFocusM: 1.5,
        startID: 2
    });
伴我心暖 2024-12-15 11:02:01

我知道现在回答这个问题有点晚了。 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.

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