Onswitch dari tab melakukan sesuatu

$(window).blur(function(e) {
	alert('You have moved from this tab/window.');
});
godfreysseki