Authored by unknown

男首优选品牌js修改

@@ -18,6 +18,7 @@ var $ = require('yoho.jquery'), @@ -18,6 +18,7 @@ var $ = require('yoho.jquery'),
18 18
19 LogoBrand.prototype = { 19 LogoBrand.prototype = {
20 init: function() { 20 init: function() {
  21 + this.$element.addClass('logos-' + this.options.showNum);
21 this._sendRequest(); 22 this._sendRequest();
22 }, 23 },
23 _createHelper: function() { 24 _createHelper: function() {
@@ -72,8 +73,8 @@ var $ = require('yoho.jquery'), @@ -72,8 +73,8 @@ var $ = require('yoho.jquery'),
72 '<a href="\{{href}}"><img class="lazy" data-original="\{{img}}" alt=""></a>' + 73 '<a href="\{{href}}"><img class="lazy" data-original="\{{img}}" alt=""></a>' +
73 '\{{/brandList}}'; 74 '\{{/brandList}}';
74 brandTpl = Handlebars.compile(brandHtml); 75 brandTpl = Handlebars.compile(brandHtml);
75 - $('.logo-brand').addClass('logos-' + that.options.showNum).html(brandTpl(data));  
76 - lazyLoad($('.logo-brand').find('img.lazy')); 76 + that.$element.html(brandTpl(data));
  77 + lazyLoad(that.$element.find('img.lazy'));
77 that._bindEvent(); 78 that._bindEvent();
78 } 79 }
79 }); 80 });