Reputation: 315
I need to use some scripts after window.onblur event. But on my app i have Google Maps, which one is injected into iframe. Evervy click on iframe firing window.onblur(). How to prevent this?
Upvotes: 1
Views: 1152
Reputation:
You can prevent the default window.blur event if the original target of the event is the iframe.
$(window).blur(function(event){
if($(event.target).attr('id')== "myiframe"){
event.preventDefault();
}
});
Upvotes: 1