想问一下为什么jq异步加载数据第一次加载没问题,再次加载的时候为什么就不执行了呢。
发现bug:
item: function() {
var $box = this.$element,
_coord = [],
_num = 0,
_options = this.options,
i = 0,
$items = $box.find(this.options.fallsCss),
fallsWidth = $items.eq(0).outerWidth() + this.options.margin,
boxWidth = $box.outerWidth() + this.options.margin,
_autoWidth = 0;在后面插入:
if (boxWidth < fallsWidth) {
boxWidth = $(window).width();
}解决找不到节点时width报错,设置为设备宽度即可