Time ago we made something similar to this:
I have this script:
code:
<script language="JavaScript1.2">
<script language="JavaScript1.2">
var delay=100 //pausa (en milisegundos)
var fcontent=new Array()
begintag='<font face="Arial" size=2>' //tag que abre los mensajes
fcontent[0]="<a href='#'>hola</a>"
fcontent[1]="<a href='#'>hola 2</a>"
fcontent[2]="<a href='#'>hola 3</a>"
closetag='</font>'
var fwidth=150 //ancho
var fheight=150 //alto
///No editar/////////////////
var ie4=document.all&&!document.getElementById
var ns4=document.layers
var DOM2=document.getElementById
var index=0
if (DOM2)
faderdelay=100
//function to change content
function changecontent(){
if (index>=fcontent.length)
index=0
if (DOM2){
document.getElementById("fscroller").style.color="rgb(255,255,255)"
document.getElementById("fscroller").innerHTML=begintag+fcontent[index]+closetag
}
else if (ie4)
document.all.fscroller.innerHTML=begintag+fcontent[index]+closetag
else if (ns4){
document.fscrollerns.document.fscrollerns_sub.document.write(begintag+fcontent[index]+closetag)
document.fscrollerns.document.fscrollerns_sub.document.close()
}
index++
setTimeout("changecontent()",delay+faderdelay);
}
if (ie4| |DOM2)
document.write('<div id="fscroller" style="border:1px solid black;width:'+fwidth+';height:'+fheight+';padding:2px"></div>')
window.onload=changecontent
</script>
this change the content every time into the layer:
<ilayer id="fscrollerns" width=&{fwidth}; height=&{fheight};><layer id="fscrollerns_sub" width=&{fwidth}; height=&{fheight}; left=0 top=0></layer></ilayer>
Then, I want to make the script stops when the mouse is over, and i assigned the setTimeout("colorfade()",20); to a variable (tiempo=setTimeout("colorfade()",20)
Then to stop it I made a function:
code:
function detener()
{clearTimeout(tiempo)}
My problem is: I need to add the mouseover function into the array fcontent
And I'm makinng this:
code:
var delay=100 //pausa (en milisegundos)
var fcontent=new Array()
begintag='<font face="Arial" size=2>' //tag que abre los mensajes
fcontent[0]="<a href='#' onmuseover='detener();'>hola</a>"
fcontent[1]="<a href='#' onmuseover='detener();'>hola 2</a>"
fcontent[2]="<a href='#' onmuseover='detener();'>hola 3</a>"
closetag='</font>'
But seems not to work, then I thought:' Lets make the moseover part into a variable!, the problem could be the quotes (Singles and not double)'
And I made something like this:
code:
var moseover=onmuseover="detener();"
begintag='<font face="Arial" size=2>' //tag que abre los mensajes
fcontent[0]="<a href='#' '+mouseover+'>hola</a>"
fcontent[1]="<a href='#' '+mouseover+'>hola 2</a>"
fcontent[2]="<a href='#' '+mouseover+'>hola 3</a>"
closetag='</font>'
But nothing happens!!!!!!