--------------------------------------------------- | Date: 2003-01-19 20:31:49 | | Filename: scrolltitle.js | | Author: detour@metalshell.com | | | | http://www.metalshell.com/ | --------------------------------------------------- <!-- scrolltitle.js by detour@metalshell.com --> <!-- Scroll a message across the title bar forwards, --> <!-- backwards and with a delay. --> <!-- http://www.metalshell.com --> <script language="javaScript"> var pos=0; var str="Metalshell "; // npos is used for forward scrolling var npos=str.length; // Normal upDate(). Other options upDateFW() and upDateWD() setInterval("upDate()",300); // Normal Scroll function upDate() { // Reset the title starting at pos document.title=str.substring(pos,str.length)+str.substring(0,pos); if(pos < str.length) pos++; else pos = 0; } // Scroll forward function upDateFW() { // Reset the title starting at pos document.title=str.substring(npos,str.length)+str.substring(0,npos); if(npos > 0) npos--; else npos = str.length; } // Scroll With Delay var delay = 20; function upDateWD() { if(pos < str.length) { document.title=str.substring(pos,str.length)+str.substring(0,pos); } else { if(pos > str.length+delay) { pos = 0; } } pos++; } </script>