By this simple piece of java script code you can scroll a message on the webpage .The message is called on the body load of the page .
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
head
runat
=
"server"
>
<
title
>title
>
<
script
type
=
"text/javascript"
>
function statusMessageObject(p, d) {
this.msg = MESSAGE
this.out = " "
this.pos = POSITION
this.delay = DELAY
this.i = 0
this.reset = clearMessage
}
function clearMessage() {
this.pos = POSITION
}
var POSITION = 100
var DELAY = 50
var MESSAGE = "Hello Dear,how r u."
var scroll = new statusMessageObject()
function scrollingtext() {
for (scroll.i = 0; scroll.i <
scroll.pos
; scroll.i++) {
scroll.out += " "
}
if (scroll.pos >= 0)
scroll.out += scroll.msg
else scroll.out = scroll.msg.substring(-scroll.pos, scroll.msg.length)
window.status = scroll.out
scroll.out = " "
scroll.pos--
if (scroll.pos < -(scroll.msg.length)) {
scroll.reset()
}
setTimeout('scrollingtext()', scroll.delay)
}
script
>
head
>
<
body
onload
=
"scrollingtext()"
>
<
form
id
=
"form1"
runat
=
"server"
>
<
div
>
div
>
form
>
body
>
html
>
Screen shot of the program:
