Home
 
 
Search:  
C C++ Perl PHP Python HTML ShellScripts
 
 
  Coding Books
  Tutorials
  Search Code
  Browse Code
  Link to Us
  Site News
  Contact Metalshell
 
 
 
  Submit Code   Statistics
 



Html Goodies    (ISBN: 0789718235)


 

 List Price: $19.99
 Our Price: $19.99
 Used Price: $6.50

 Release Date: November, 1998
 Manufacturer: MacMillan Publishing Company (Paperback)
 Sales Rank: 4,592

 Author: Joe Burns









More Info

 Javascript Scroll Title Bar 2003-01-19 20:31:49
  html 
Category: source:html:javascript
Description: Scroll a message across the title of your web browser.
Platform: all
Author: detour
Viewed: 6450
Rating: 3.7/5 (21 votes)
If you have any questions about this piece of code or still need help, try posting your question on the forum.

 

Printable Version
scrolltitle.js
<!-- 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>
Rate this code:
(Not Helpful)  (Very Helpful) 

 
 
   Developer.*  
   Blue Parrots  
   Technipal  
   Defy Magazine  
   Code Project  
   Prog. Heaven  


Got Money?