jQuery(或其他东西)在IE8上运行不正常 [英] jQuery (or something) is not working properly on IE8

查看:61
本文介绍了jQuery(或其他东西)在IE8上运行不正常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我被告知要在IE9中测试一下 - 它在IE9中运行正常(对我来说,
无论如何)。

I was told to test this in IE9 - It works fine in IE9 (for me, anyways).

一位朋友告诉我这个页面在IE8上运行不正常 - 我被告知缩略图正在正确加载,但中心的图像不是。我没有IE8,但是我试图下载它是不成功的。

I was told by a friend that THIS page is not running properly on IE8 - I was told that the thumbnails are loading properly, but the image in the center is not. I do not have IE8 and I have been unsuccessful in my attempt to download it.

图像正在通过jQuery加载(好了,调整好)我觉得这是我的javascript代码以某种方式失败,导致IE8中描述的错误。

The images are being loaded (well, adjusted) through jQuery and I have a feeling that it is my javascript code that is failing in some way, causing the described errors in IE8.

我把我的代码通过JSLint,我看到的错误告诉我添加代码中的空格 - 但我非常怀疑这可能导致IE8问题。

I put my code through JSLint and the errors I saw were telling me to add spaces in the code - but I highly doubt this could be causing the IE8 issue.

正在加载的JS文件是slideshow.js,可以通过Chrome浏览器轻松找到检查元素。

The JS file being loaded is "slideshow.js" which can be easily found through Chrome's inspect element.

我将继续检查这一点,以寻找JS错误和什么不是,但我真的很感激这个问题的一些帮助。

I will keep inspecting this from my end looking for JS errors and what not but I would really appreciate some help on this issue.

非常感谢,

Evan

推荐答案

问题是IE8不支持naturalWidth属性。相反,应该创建一个新的图像对象,并从这个新的图像对象中获取宽度。

The problem was that IE8 does not support the "naturalWidth" property. Rather, one should create a new image object, and get the "width" from this new image object.

有关更多详细信息,请参阅此 link ..

For more details, refer to this link..

这篇关于jQuery(或其他东西)在IE8上运行不正常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆