render:function () {
var self = this;
$.ajax({url:'/db/list.json', dataType:'JSON'}).done(function (json) {
var html = tmpl['video-list']({videos:json});
self.$el.html(html);
});
console.log($('.video-thumb-box'));
$.each($('.video-thumb-box'), function(){
console.log(this);
$(this).bind('mouseenter', function(){
console.log($('.video-thumb-info', this));
});
});
}
tmpl['video-list']({videos:json})
是下划线模板并包含DIV
s 中的项目列表这是示例返回
<div class="span3">
<a href="#/video/123">
<div class="video-thumb-box">
<img class="video-thumb-img" src="test" alt="Video tumbnail">
<div class="video-thumb-info hide">
<img class="pull-right" width="16" height="16" src="/img/icons/namba.png">
something
</div>
</div>
</a>
</div>
<div class="span3">
<a href="#/video/123">
<div class="video-thumb-box">
<img class="video-thumb-img" src="test" alt="Video tumbnail">
<div class="video-thumb-info hide">
<img class="pull-right" width="16" height="16" src="/img/icons/namba.png">
something
</div>
</div>
</a>
</div>
为什么我找不到任何东西$('.video-thumb-box')
?