Moving text in IE statusbar

sumitmehta

New Member
Messages
215
Reaction score
1
Points
0
Here is a simple tutorial in javascript on moving text in IE statusbar.

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Test Page</title>
</head>

<body onload="setStatus();">

<script language="javascript" >

var s="I am testing moving text       ";

var l=0;
var ll=s.length;

function setStatus() {
    
    var ss=s.substr(l,s.length-l);
    var sss=s.substr(0,l);
    
    
    ss=ss + sss;
    
    window.status=ss;
    
    l=l+1;
    
    if(l==s.length) {
        l=0;
    }
    setTimeout("setStatus()",500);
}
</script>
</body>

</html>
 
Last edited:

felixjerms

New Member
Messages
2
Reaction score
0
Points
0
Thanks for the tutorial. It would be a better teaching device if you commented the code to explain what it does, and also if you gave the variables more appropriate names such as 'movingtext' or 'offset'. In fact those would probably be good ideas even in code that's just for your own use.
 

sumitmehta

New Member
Messages
215
Reaction score
1
Points
0
You are right felixjerms. But this code was not written by me but by my friend. And I understood it even without comments so felt no need to add comments. But thanks anyways. I will try to comment the codings in future.
 

Sohail

Active Member
Messages
3,055
Reaction score
0
Points
36
Nice tutorial, this might come in handy for me soon as i am still developing my flash site but i will bookmark this page for future reference.
 
Top