jQuery event.preventDefault() not working in Firefox (JSFiddle included)

前端 未结 5 548
梦毁少年i
梦毁少年i 2020-12-04 13:17

This is a kind of similar duplicate to some others here, but I think I\'m using event.preventDefault() correctly in this case.

Here\'s a JSFiddle you ca

5条回答
  •  忘掉有多难
    2020-12-04 13:57

    Ah I've had a similar problem in that past. Rather than event.preventDefault() try passing the event to:

        function ie8SafePreventEvent(e){
        if(e.preventDefault){ e.preventDefault()}
        else{e.stop()};
    
        e.returnValue = false;
        e.stopPropagation();        
    }
    

    I know it says IE, but I've never had a problem with it since =]

提交回复
热议问题