Javascript 主干视图上的动画
如何使我的主干滑动-主干视图上的一些动画Javascript 主干视图上的动画,javascript,jquery,backbone.js,Javascript,Jquery,Backbone.js,如何使我的主干滑动-主干视图上的一些动画 var View = Backbone.View.extend({ el : "#editor", // Bind to the editor id render : function() { var data = { item: this.model, _: _ }; var compiledTemplate = _.template( Templ
var View = Backbone.View.extend({
el : "#editor", // Bind to the editor id
render : function() {
var data = {
item: this.model,
_: _
};
var compiledTemplate = _.template( Template, data ); // Merge model with template
this.$el.html( compiledTemplate );
this.$('.editor-pane').show(500); // Does animation work here...NO!! Urgh.
return this;
}
});
对#编辑器包含。编辑器窗格
我也很满意关于#editor元素的版本:
this.$el.html( compiledTemplate ).show ('slow');
尝试使用其他方法移动动画,并在渲染后运行动画。我还建议使用jQuery“find”方法来浏览DOM
initialize: function(){
...
this.render();
this.animateView();
}
animateView: function(){
this.$el.find('.editor-pane').show(500);
}
有可能触发事件加载吗