CAN ANYONE FIGURE THIS OUT? This is a flying text script that worked great on the page but it won't validate in W3C Validator. I had to take it off but I really like the effect.
The error message is :
end tag for element "SPAN" which is not open
***********************
This is the code that the error is on.
<FONT COLOR="#ff0033"><span id="fly"></span></FONT>
<script type="text/javascript">
window.onerror=new Function("return true")
//Flying Letters script- (I took out the authors name for this forum)
//Configure message to display. Use "$" for linebreak
message = "widget $widget! $widget $widget" // $ = taking a new line
distance = 250 // pixel(s)
speed = 100 // milliseconds
if (!document.all)
document.write('+message+')
</script>
<script type="text/javascript1.2">
txt="";num=0;num4=0;flyofle="";flyofwi="";flyofto=""
function stfly(){for(i=0;i!= message.length;i++){if(message.charAt(i)!= "$"){txt=txt+"<span style='position:relative;visibility:hidden;' id='n"+i+"'>"+message.charAt(i)+"</span>"};else{txt=txt+"<br>"}};fly.innerHTML=txt;txt="";flyofle=fly.offsetLeft;flyofwi=fly.offsetWidt h;flyofto=fly.offsetTop;fly2b()}
function fly2b(){if(num4!= message.length){if(message.charAt(num4)!= "$"){eval("n"+num4+".style.left=flyofle-n"+num4+".offsetLeft+flyofwi/2");eval("n"+num4+".style.top=flyofto-n"+num4+".offsetTop+distance");eval("fly3('n"+num4+"',eval(n"+num4+".style.left.substring(0,n"+num4+ ".style.left.length-2)),(eval(n"+num4+".style.left.substring(0,n"+num4+".style.left.length-2))/5),eval(n"+num4+".style.top.substring(0,n"+num4+".style.top.length-2)),(eval(n"+num4+".style.top.substring(0,n"+num4+".style.top.length-2))/5))")};num4++;setTimeout("fly2b()",speed)}}
function fly3(target,lef2,num2,top2,num3){if((Math.floor(top2)!= 0 && Math.floor(top2)!= -1) ¦¦ (Math.floor(lef2)!= 0 && Math.floor(lef2)!= -1)){if(eval("'"+lef2+"'").charAt(0)!= '-'){lef2=lef2-num2};else{lef2=lef2+(-num2)};if(Math.floor(lef2)!= -1){eval(target+".style.visibility='visible';"+target+".style.left=Math.floor(lef2)")};else{eval(targ et+".style.visibility='visible';"+target+".style.left=Math.floor(lef2+1)")};if(eval("'"+lef2+"'").ch arAt(0)!= '-'){top2=top2-num3};else{top2=top2+(-num3)};if(Math.floor(top2)!= -1){eval(target+".style.top=Math.floor(top2)")};else{eval(target+".style.top=Math.floor(top2+1)")};se tTimeout("fly3('"+target+"',"+lef2+","+num2+","+top2+","+num3+")",50)}};
stfly()
</script>
The error message is :
end tag for element "SPAN" which is not open
***********************
This is the code that the error is on.
<FONT COLOR="#ff0033"><span id="fly"></span></FONT>
<script type="text/javascript">
window.onerror=new Function("return true")
//Flying Letters script- (I took out the authors name for this forum)
//Configure message to display. Use "$" for linebreak
message = "widget $widget! $widget $widget" // $ = taking a new line
distance = 250 // pixel(s)
speed = 100 // milliseconds
if (!document.all)
document.write('+message+')
</script>
<script type="text/javascript1.2">
txt="";num=0;num4=0;flyofle="";flyofwi="";flyofto=""
function stfly(){for(i=0;i!= message.length;i++){if(message.charAt(i)!= "$"){txt=txt+"<span style='position:relative;visibility:hidden;' id='n"+i+"'>"+message.charAt(i)+"</span>"};else{txt=txt+"<br>"}};fly.innerHTML=txt;txt="";flyofle=fly.offsetLeft;flyofwi=fly.offsetWidt h;flyofto=fly.offsetTop;fly2b()}
function fly2b(){if(num4!= message.length){if(message.charAt(num4)!= "$"){eval("n"+num4+".style.left=flyofle-n"+num4+".offsetLeft+flyofwi/2");eval("n"+num4+".style.top=flyofto-n"+num4+".offsetTop+distance");eval("fly3('n"+num4+"',eval(n"+num4+".style.left.substring(0,n"+num4+ ".style.left.length-2)),(eval(n"+num4+".style.left.substring(0,n"+num4+".style.left.length-2))/5),eval(n"+num4+".style.top.substring(0,n"+num4+".style.top.length-2)),(eval(n"+num4+".style.top.substring(0,n"+num4+".style.top.length-2))/5))")};num4++;setTimeout("fly2b()",speed)}}
function fly3(target,lef2,num2,top2,num3){if((Math.floor(top2)!= 0 && Math.floor(top2)!= -1) ¦¦ (Math.floor(lef2)!= 0 && Math.floor(lef2)!= -1)){if(eval("'"+lef2+"'").charAt(0)!= '-'){lef2=lef2-num2};else{lef2=lef2+(-num2)};if(Math.floor(lef2)!= -1){eval(target+".style.visibility='visible';"+target+".style.left=Math.floor(lef2)")};else{eval(targ et+".style.visibility='visible';"+target+".style.left=Math.floor(lef2+1)")};if(eval("'"+lef2+"'").ch arAt(0)!= '-'){top2=top2-num3};else{top2=top2+(-num3)};if(Math.floor(top2)!= -1){eval(target+".style.top=Math.floor(top2)")};else{eval(target+".style.top=Math.floor(top2+1)")};se tTimeout("fly3('"+target+"',"+lef2+","+num2+","+top2+","+num3+")",50)}};
stfly()
</script>
Comment