javascript - IE 和 jQuery Masonry 不同意,(无法在初始化之前调用 Masonry 上的方法)

标签 javascript jquery internet-explorer jquery-masonry

我有一个使用 jQuery Masonry 插件构建的网站,该网站在 Firefox 和 Chrome 中运行良好,但是在 IE9 上首次运行时,布局被破坏,并且似乎没有加载 Masonry。

这是输出到 IE9 控制台的错误。

cannot call methods on masonry prior to initialization; attempted to call method 'appended'

这里是暂存站点的链接:http://rw.freelanc3r.co.uk/请先在 Chrome 或 Firefox 中查看,然后再在 IE 中查看以查看所需的结果。

我知道页面上没有图像,请忽略这个小缺陷。

最佳答案

我怀疑 Masonry 初始化代码放置在 imagesLoaded 回调中,并且实际上没有加载任何图像,这一事实可能存在问题。 FF、Chrome 和 IE9 在如何处理这种情况方面可能有不同的行为。

页面加载图片时还会出现这个问题吗?

关于javascript - IE 和 jQuery Masonry 不同意,(无法在初始化之前调用 Masonry 上的方法),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8464035/

相关文章:

javascript - 如何解决Google Charts loader.js只能加载一次

javascript - 在 Jquery Modal 对话框中单击“确定”按钮时触发事件

python - 如何在 Selenium 和 Python 中通过 IEDriverServer 使用 DesiredCapabilities 类

javascript - 警告 : Failed prop type: Invalid prop `component` of type `object` supplied to `Route` , 预期 `function` 使用 react-router-dom 时出错

javascript - 需要一些关于正则表达式验证的指示

javascript - Jquery 帮助 : Draggable to Sortable and then back to draggable again

css - z-index 属性不会导致 IE8 中的重叠

javascript - fakeLoader.js如何让页面流畅跳转?

javascript - 按钮点击在移动设备上不起作用

internet-explorer - IE9 兼容模式是否是测试 IE7-8 的有效方法?