Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/design-patterns/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 主干视图上的动画_Javascript_Jquery_Backbone.js - Fatal编程技术网

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);
}

有可能触发事件加载吗