Hi all.
I have hard-coded several images as onMouseOver links but I need to achieve the same result using a loop somehow. That is, rather than as in my p.s. below where I have explicitly coded all the image names and positions, I need to be able to make these references variable depending on where I am within a loop.
With languages I know I would do something like the following:
name_str = 'thursday,friday ,saturday,sunday '
kount = 0
FOR loop=1 TO 28 STEP 9
kount = kount + 1
which = ALLTRIM(STR(kount))
** The next line would hold "thursday.png" when loop = 1
image_name = SUBSTR(name_str,loop,8)+".png"
** The next line displays "thursday.png"
?&image_name
ENDFOR
The & symbol lets me display the contents of the variable.
Is there a similar way to achieve the same result using JavaScript? What is the equivalent to & for numbered variables created within a JavaScript loop?
Thanks a lot.
Russell.
p.s. The following is the code I have at the moment:
<a href="Connect.asp" target="list" onMouseOver="hiLite('thursday','thursday_on','Option 1')"
onMouseOut="hiLite('thursday','thursday_off','')">
<img name="thursday" style="position:absolute;top:92;left:1;border-style: solid; border-color: black" src="thursday_off.png" border="1" width="117" height="29"></a>
<a href="Connect.asp" target="list" onMouseOver="hiLite('friday','friday_on','Option 2')"
onMouseOut="hiLite('friday','friday_off','')">
<img name="friday" style="position:absolute;top:121;left:1;border-style: solid; border-color: black" src="friday_off.png" border="1" width="117" height="29"></a>
<a href="Connect.asp" target="list" onMouseOver="hiLite('saturday','saturday_on','Option 3')"
onMouseOut="hiLite('saturday','saturday_off','')">
<img name="saturday" style="position:absolute;top:150;left:1;border-style: solid; border-color: black" src="saturday_off.png" border="1" width="117" height="29"></a>
<a href="Connect.asp" target="list" onMouseOver="hiLite('sunday','sunday_on','Option 4')"
onMouseOut="hiLite('sunday','sunday_off','')">
<img name="sunday" style="position:absolute;top:179;left:1;border-style: solid; border-color: black" src="sunday_off.png" border="1" width="117" height="29"></a>
I have hard-coded several images as onMouseOver links but I need to achieve the same result using a loop somehow. That is, rather than as in my p.s. below where I have explicitly coded all the image names and positions, I need to be able to make these references variable depending on where I am within a loop.
With languages I know I would do something like the following:
name_str = 'thursday,friday ,saturday,sunday '
kount = 0
FOR loop=1 TO 28 STEP 9
kount = kount + 1
which = ALLTRIM(STR(kount))
** The next line would hold "thursday.png" when loop = 1
image_name = SUBSTR(name_str,loop,8)+".png"
** The next line displays "thursday.png"
?&image_name
ENDFOR
The & symbol lets me display the contents of the variable.
Is there a similar way to achieve the same result using JavaScript? What is the equivalent to & for numbered variables created within a JavaScript loop?
Thanks a lot.
Russell.
p.s. The following is the code I have at the moment:
<a href="Connect.asp" target="list" onMouseOver="hiLite('thursday','thursday_on','Option 1')"
onMouseOut="hiLite('thursday','thursday_off','')">
<img name="thursday" style="position:absolute;top:92;left:1;border-style: solid; border-color: black" src="thursday_off.png" border="1" width="117" height="29"></a>
<a href="Connect.asp" target="list" onMouseOver="hiLite('friday','friday_on','Option 2')"
onMouseOut="hiLite('friday','friday_off','')">
<img name="friday" style="position:absolute;top:121;left:1;border-style: solid; border-color: black" src="friday_off.png" border="1" width="117" height="29"></a>
<a href="Connect.asp" target="list" onMouseOver="hiLite('saturday','saturday_on','Option 3')"
onMouseOut="hiLite('saturday','saturday_off','')">
<img name="saturday" style="position:absolute;top:150;left:1;border-style: solid; border-color: black" src="saturday_off.png" border="1" width="117" height="29"></a>
<a href="Connect.asp" target="list" onMouseOver="hiLite('sunday','sunday_on','Option 4')"
onMouseOut="hiLite('sunday','sunday_off','')">
<img name="sunday" style="position:absolute;top:179;left:1;border-style: solid; border-color: black" src="sunday_off.png" border="1" width="117" height="29"></a>
Comment