首页 > Backbone.js开发中遇到的event事件问题?click失效?

Backbone.js开发中遇到的event事件问题?click失效?

events: {
    "click .cpm-title a.col-xs-6": "collect",
    "click .js-buy": "buy"
},
initialize: function (attrs) {
     this.model = new Model();
     this.model.fetch();
     this.model.on("sync", this.render,this);
},
buy:function(){
    $("body").css('backgroundColor','red');
    alert(11)
}

<div class="cpm-cart">
    <span class="js-buy">立即购买</span>
    <span class="js-cart">加入购物车</span> //一开始使用a标签无效,span也无效
</div>

在PC端click是可以触发的,在手机上却无法点击(不要说缓存)


能把相关的所有源码贴下么,包括你 View 的 el 不然问题不好判断


手机是iOS吗?可以用 fastclick https://github.com/ftlabs/fastclick

【热门文章】
【热门文章】