I tried this function to disable page if it is not on focus.
$(window).focus(function() {
$("body").show();
}).blur(function() {
$("body").hide();
});
it works, the problem is depending where user click on the page (it will still focus, since user clicks on the page) the body will hide and will show again when user click back.
Another problem is when user click in the address bar, it will hide the body too. Can I solve this things? what is wrong?