jQuery石工插件未激活 [英] jQuery masonry plugin not being activated
本文介绍了jQuery石工插件未激活的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试实现jquery砌体图像插件,它似乎设置正确,但是无法正常工作!
I'm trying to implement the jquery masonry images plugin, it seems to be setup right, but it's not working!
我使用浏览器进行调试,但没有看到任何错误.
I debugged using my browser, and didn't see any errors.
我可能做错了什么?代码如下.谢谢.费萨尔
What could I be doing wrong? Code is below. Thanks. Faisal
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
<script src="/assets/jquery.js"></script>
<script src="/assets/jquery.masonry.min.js"></script>
<style>
.item {
width: 200px;
.... }
</style>
<div id="container">
<div class="item">
....
</div>
<script>
$(function(){
var $container = $('#container');
$container.imagesLoaded(function(){
$container.masonry({
itemSelector : '.tile',
columnWidth : 240
});
});
});
</script>
</div>
推荐答案
我从您的代码中看到的唯一问题是以下行:
The only problem I can see from your code is this line:
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
您尚未在指向jQuery文件的链接的开头添加"http:".不应该是:
You haven't added a "http:" to the beginning of your link to your jQuery file. Shouldn't it be:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
您可以上传页面的jsFiddle版本吗?
Can you upload a jsFiddle version of your page?
这篇关于jQuery石工插件未激活的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文