複数のタイマーを作成しようとしています。私を助けることができるチュートリアル。最も難しいのはhtmlパーツで、サンプルプロジェクトで私のファイルをリンクする方法は私には良いことです。c#、mvc、backbone、timer
Html5.Views.Timer = Backbone.View.extend({
el: 'div#timer',
initialize: function() {
timer = this.model;
this.render();
},
events: {
"clicked div#add_time": "update_timer"
}
render: function() {
$(this.el).append(HandlebarsTemplates['timer'](timer);
this.start_timer();
},
start_timer: function() {
clearTimeout(this.main_timer);
this.main_timer = setTimeout(function() {
if (this.countDownInstance) {
this.countDownInstance.clearRewriteCounter();
}
this.countDownInstance = new countDown(timed.length, 'main_timer');
}, timed_length*1000);
},
update_timer: function() {
timed.length = timed.length+30
this.start_timer();
}
});
質問を再投稿しないでください。 – Will