我正在尝试在主干应用程序中使用此延迟加载插件,我调整了模板以与插件一起使用并调用插件脚本,但是当我更新浏览器时,似乎所有视图图像都已呈现,所以延迟加载无法正常工作。
这是小提琴:http: //jsfiddle.net/9R9zU/55/
我在这里使用延迟加载:
app.BookView = Backbone.View.extend ({
tagName: 'div',
className: 'book',
template: _.template( $( '#bookTemplate' ).html()),
render: function() {
this.$el.html(this.template(this.model.toJSON()));
this.$el.find("img").unveil();//lazy loading
return this;
}
});