Hi,
when I try to see the effect of the following script
I do not see anything when using Netscape Navigator whereas
InternetExplore r ist ok.
In Netscape Javascript is activated. What could be the problem?
Thank you for your help.
<head>
<STYLE>.spansty le {
COLOR: green; FONT-FAMILY: Verdana; FONT-SIZE: 10pt;
FONT-WEIGHT: bold; POSITION: absolute; TOP: -50px; VISIBILITY: visible
}
</STYLE>
<SCRIPT>
var x,y
var step=20
var flag=0
//
var message="THIS IS A TEST!!"
message=message .split("")
var xpos=new Array()
for (i=0;i<=message .length-1;i++) {
xpos[i]=-50
}
var ypos=new Array()
for (i=0;i<=message .length-1;i++) {
ypos[i]=-50
}
function handlerMM(e){
x = (document.layer s) ? e.pageX :
document.body.s crollLeft+event .clientX
y = (document.layer s) ? e.pageY :
document.body.s crollTop+event. clientY
flag=1
}
function makesnake() {
if (flag==1 && document.all) {
for (i=message.leng th-1; i>=1; i--) {
xpos[i]=xpos[i-1]+step
ypos[i]=ypos[i-1]
}
xpos[0]=x+step
ypos[0]=y
for (i=0; i<message.lengt h-1; i++) {
var thisspan = eval("span"+(i) +".style")
thisspan.posLef t=xpos[i]
thisspan.posTop =ypos[i]
}
}
else if (flag==1 && document.layers ) {
for (i=message.leng th-1; i>=1; i--) {
xpos[i]=xpos[i-1]+step
ypos[i]=ypos[i-1]
}
xpos[0]=x+step
ypos[0]=y
for (i=0; i<message.lengt h-1; i++) {
var thisspan = eval("document. span"+i)
thisspan.left=x pos[i]
thisspan.top=yp os[i]
}
}
var timer=setTimeou t("makesnake()" ,30)
}
</SCRIPT>
</head>
<body onload="makesna ke()" style="OVERFLOW-X: hidden; OVERFLOW-Y:
scroll; WIDTH: 100%" BACKGROUND>
<SCRIPT>
<!-- Beginning of JavaScript -
for (i=0;i<=message .length-1;i++) {
document.write( "<span id='span"+i+"' class='spanstyl e'>")
document.write( message[i])
document.write( "</span>")
}
if (document.layer s){
document.captur eEvents(Event.M OUSEMOVE);
}
document.onmous emove = handlerMM;
// - End of JavaScript - -->
</SCRIPT>
</body>
</html>
when I try to see the effect of the following script
I do not see anything when using Netscape Navigator whereas
InternetExplore r ist ok.
In Netscape Javascript is activated. What could be the problem?
Thank you for your help.
<head>
<STYLE>.spansty le {
COLOR: green; FONT-FAMILY: Verdana; FONT-SIZE: 10pt;
FONT-WEIGHT: bold; POSITION: absolute; TOP: -50px; VISIBILITY: visible
}
</STYLE>
<SCRIPT>
var x,y
var step=20
var flag=0
//
var message="THIS IS A TEST!!"
message=message .split("")
var xpos=new Array()
for (i=0;i<=message .length-1;i++) {
xpos[i]=-50
}
var ypos=new Array()
for (i=0;i<=message .length-1;i++) {
ypos[i]=-50
}
function handlerMM(e){
x = (document.layer s) ? e.pageX :
document.body.s crollLeft+event .clientX
y = (document.layer s) ? e.pageY :
document.body.s crollTop+event. clientY
flag=1
}
function makesnake() {
if (flag==1 && document.all) {
for (i=message.leng th-1; i>=1; i--) {
xpos[i]=xpos[i-1]+step
ypos[i]=ypos[i-1]
}
xpos[0]=x+step
ypos[0]=y
for (i=0; i<message.lengt h-1; i++) {
var thisspan = eval("span"+(i) +".style")
thisspan.posLef t=xpos[i]
thisspan.posTop =ypos[i]
}
}
else if (flag==1 && document.layers ) {
for (i=message.leng th-1; i>=1; i--) {
xpos[i]=xpos[i-1]+step
ypos[i]=ypos[i-1]
}
xpos[0]=x+step
ypos[0]=y
for (i=0; i<message.lengt h-1; i++) {
var thisspan = eval("document. span"+i)
thisspan.left=x pos[i]
thisspan.top=yp os[i]
}
}
var timer=setTimeou t("makesnake()" ,30)
}
</SCRIPT>
</head>
<body onload="makesna ke()" style="OVERFLOW-X: hidden; OVERFLOW-Y:
scroll; WIDTH: 100%" BACKGROUND>
<SCRIPT>
<!-- Beginning of JavaScript -
for (i=0;i<=message .length-1;i++) {
document.write( "<span id='span"+i+"' class='spanstyl e'>")
document.write( message[i])
document.write( "</span>")
}
if (document.layer s){
document.captur eEvents(Event.M OUSEMOVE);
}
document.onmous emove = handlerMM;
// - End of JavaScript - -->
</SCRIPT>
</body>
</html>
Comment