ImagesLoaded with Masonry, Object #lt;Objectgt; has no method #39;imagesLoaded#39;(ImagesLoaded with Masonry, Object #lt;Objectgt;没有方法“imagesLoaded)
问题描述
遇到此错误,尝试将 Masonry 与 imageLoaded 一起使用:
Getting this error, trying to use Masonry with imageLoaded:
对象#没有方法'imagesLoaded'"
"Object # has no method 'imagesLoaded'"
必要脚本的链接在我的标题中:
The links to the necessary scripts are in my header:
<script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script><script src="/js/masonry.pkgd.min.js" type="text/javascript"></script>
<script src="/js/imagesloaded.pkgd.min.js" type="text/javascript"></script>
下面是代码在我的页脚中的样子:
And here is how the code looks in my footer:
$(document).ready(function() {
$('#archive-post-container').imagesLoaded(function() {
$(this).masonry({
itemSelector : '.post',
columnWidth:344
});
});
});
编辑/附录:将 ImagesLoaded 和 Masonry 的脚本标签放在我需要它们的页面的实际 .php 文件中,而不是放在 header.php 中,这会导致我出现此错误,来自 ImagesLoaded:Uncaught TypeError: undefined is not a function
EDIT / ADDENDUM: Placing the script tags for ImagesLoaded and Masonry in the actual .php file for the page I need them on, instead of in header.php gets me this error instead, coming from ImagesLoaded: Uncaught TypeError: undefined is not a function
不知道为什么将标签从标题移动到标题下方会改变这一点,但至少现在我正在使用 imagesLoaded?
Not sure why moving the tags just from the to just under the header would change this, but at least now I am getting to imagesLoaded?
推荐答案
请注意,ImageLoaded 不再包含在最新的 Masonry 发行版中,每
Note that ImagesLoaded is no longer included in the latest Masonry distribution, per
http://masonry.desandro.com/appendix.html#upgrading-从-v2
你可以直接在这里获取:
You can get it directly here:
http://desandro.github.io/imagesloaded/
这篇关于ImagesLoaded with Masonry, Object #<Object>没有方法“imagesLoaded"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:ImagesLoaded with Masonry, Object #<Object>没有


基础教程推荐
- 如何添加到目前为止的天数? 2022-01-01
- npm start 错误与 create-react-app 2022-01-01
- Bootstrap 模态出现在背景下 2022-01-01
- 原生拖动事件后如何获取 mouseup 事件? 2022-01-01
- Fabric JS绘制具有活动形状的多边形 2022-01-01
- 即使用户允许,Gmail 也会隐藏外部电子邮件图片 2022-01-01
- 在 contenteditable 中精确拖放 2022-01-01
- Bokeh Div文本对齐 2022-01-01
- 检查 HTML5 拖放文件类型 2022-01-01
- fetch 是否支持原生多文件上传? 2022-01-01