JS在Fiddle中很好,但在Squarespace网站上浏览器resize之前没有动画

我正在使用jQuery Isotope来动画我网站上的图像。 它在jsFiddle中工作正常,但动画拒绝初始化,直到我在网站本身调整浏览器大小。

我已经查看了其他相关问题,并尝试将代码包装在一个就绪函数中并查找隐藏的字符,但似乎没有任何工作。 该网站是:

http://rgbdrinks.squarespace.com

小提琴是:

http://jsfiddle.net/tutmoses/kxLck/3/

任何帮助感激不尽。

安德鲁


This is a test

var $container = $('#container') // initialize Isotope $container.isotope({ // options... sortBy : 'random', resizable : true, itemSelector : '.item', animationEngine : 'best-available', // set columnWidth to a percentage of container width masonry: { columnWidth: $container.width() / 6 } }); // update columnWidth on window resize $(document).ready(function() { $(window).smartresize(function(){ $container.isotope({ // update columnWidth to a percentage of container width masonry: { columnWidth: $container.width() / 6 } }); }); });