Remove event listener from window object using jquery

前端 未结 2 1761
误落风尘
误落风尘 2021-01-02 07:52

I am trying to remove blur and focus event listeners from window object using jquery\'s unbind function using:

function removeWindo         


        
2条回答
  •  情深已故
    2021-01-02 07:56

    try binding with jquery see Using JQuery to bind "focus" and "blur" functions for "window", doesn't work in IE

    $(function() {
        $(window).focus(function() {
            console.log('Focus');
        });
    
        $(window).blur(function() {
            console.log('Blur');
        });
    });
    

提交回复
热议问题