骨干滚动事件不会触发。单击事件和 jquery 附加滚动有效。这也是一个小提琴:http: //jsfiddle.net/cX2UV/
js
var TView = Backbone.View.extend({
events: {
'scroll .content': 'loadMore',
'click .code': 'codeClick'
},
loadMore: function() {
this.$el.append('<p>backbone scrolling</p>');
},
codeClick: function() {
this.$el.append('<p>clicking</p>');
}
});
new TView({ el: '.target' });
$('.content').scroll(function(){ $('.target').append('jq scrolling...'); });
html
<div class="target">
<div class="content">
<div>
<span class="text">text</span>
<span class="term">termmm</span>
<span class="codes"><span class="code">12345</span></span>
</div>
<div>
<span class="text">text</span>
<span class="term">termmm</span>
<span class="codes"><span class="code">12345</span></span>
</div>
</div>
</div>
css
body {margin:1em;}
.content {background:#EEE; height: 200px; overflow: scroll;}
.code{color:#00c}