Как сделать мой основной слайд - некоторая анимация на представлении Backbone
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 содержит.editor-панель
Я также доволен версией элемента #editor:
this.$el.html( compiledTemplate ).show ('slow');
Попробуйте переместить анимацию другим способом и запустите ее после рендеринга. Также советую использовать метод поиска jQuery для просмотра DOM.
initialize: function(){
...
this.render();
this.animateView();
}
animateView: function(){
this.$el.find('.editor-pane').show(500);
}