Sometimes we need to remind users that there are new messages, and this can be achieved using the following method.
The effect is that when the web window does not get the focus and is minimized, the content displayed in the title bar "title" of the web window is "[ ]" and "[New Message]".
<script language="JavaScript"> setTimeout('flash_title()',2000); //Call function flash_title() once after 2 seconds { //Flash when the window effect is minimized, or it is not focused if(isMinStatus() || !window.focus) { newMsgCount(); } else { document.title='Order Management Center-AOOXING';//Default title content when there is no message in the window window.clearInterval(); }} //Message prompts var flag=false;function newMsgCount(){ if(flag){ flag=false; document.title='【New Order】'; }else{ flag=true; document.title='【 】'; } window.setTimeout('flash_title(0)',380); }//Judge whether the window is minimized//Var isMin = false;function isMinStatus() { // Except for Internet Explorer browser, other mainstream browsers support Window outerHeight and outerWidth attributes if(window.outerWidth != undefined && window.outerHeight != undefined){ isMin = window.outerWidth <= 160 && window.outerHeight <= 27; }else{ isMin = window.outerWidth <= 160 && window.outerHeight <= 27; } // Except for Internet Explorer browser, other mainstream browsers support Window screenY and screenX properties if(window.screenY != undefined && window.screenX != undefined ){ isMin = window.screenY < -30000 && window.screenX < -30000;//FF Chrome }else{ isMin = window.screenTop < -30000 && window.screenLeft < -30000;//IE } return isMin;}</script>