読みやすくするために、すべてをinitialize
関数の下に置きます。ここに何か問題がありますか?アラートがトリガーされるため、状態ではありません。共有アクションを非表示にしました。ホバーが不可能なため、デスクトップのホバーとモバイルのタップでそれらを表示したいと思います。ここで何かが足りませんか?
console.log()
エラーはスローされません。
App.Views.Title = Backbone.View.extend({
initialize:function(){
_.bindAll(this,"stickToTop");
this.template = _.template($("#title").html());
this.render();
$(window).scroll(this.stickToTop);
var isMobile = navigator.userAgent.match(/(iPhone|iPod|iPad|Android|BlackBerry)/);
var share = this.$(".share");
if(isMobile){
// alert('mobile')
share.on('click' , this.shareMobile , this);
}else{
// alert('not mobile')
share.on('hover' , this.shareDesktop , this);
}
},
...