How to prevent click events on the document body (maybe a bug in Cordova?)

后端 未结 2 1421
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-04 13:24

I\'m a beginner trying to develop a mobile phone game with with Kinetic Js and \"phonegap build\". I am experiencing a problem which I don\'t know how to address. I made som

2条回答
  •  佛祖请我去吃肉
    2021-01-04 13:44

    To disable clicking on anchor tag, you may simply use some css tricks, for example, you hav an anchor tag with class 'notclickable', then add css,

    .notclickable {
        pointer-events: none;
        cursor: default;
        opacity:0.7;
    }
    

    Now you can make an anchor tag disabled by adding this class

    or you may try this to prevent a click,

    $('.notclickable').live('click', function(event){
        event.preventDefault();
    });
    

    Hope this helps.

提交回复
热议问题