ChuckRW
11-23-2002, 03:16 AM
Hi folks,
Ofcourse, I have a perfect code solution for IE and NS7. In NS4.6, however, I have a problem
The problem is in bright red. When I use the name, ‘orange01’, of the image whos source is to be switched everything works fine. When I use the variable rollName it fails. The other variable curDiv and rollSource work fine. Why?
I need to use a variable for the image name, how can I do this?
THIS WORKS
<style type="text/css">
#shell01 {
position: absolute;
left: 1;
}
#div01 {
position: relative;
}
</style>
<script>
function overCol01(curDiv, rollName, rollSource) {
document.layers['shell01'].layers[curDiv].document.orange01.src=rollSource;
}
</script>
<div id="shell01" id="shell01">
<div id="div01" id="div01">
<a href="#" onmouseover="overCol01('div01', 'orange01', 'orangelit.gif');"><img border="0" id="orange01" name="orange01" src="orangedark.gif"></a>
</div>
THIS DOES NOT WORK
<style type="text/css">
#shell01 {
position: absolute;
left: 1;
}
#div01 {
position: relative;
}
</style>
<script>
function overCol01(curDiv, rollName, rollSource) {
document.layers['shell01'].layers[curDiv].document.rollName.src=rollSource;
}
</script>
<div id="shell01" id="shell01">
<div id="div01" id="div01">
<a href="#" onmouseover="overCol01('div01', 'orange01', 'orangelit.gif');"><img border="0" id="orange01" name="orange01" src="orangedark.gif"></a>
</div>
Ofcourse, I have a perfect code solution for IE and NS7. In NS4.6, however, I have a problem
The problem is in bright red. When I use the name, ‘orange01’, of the image whos source is to be switched everything works fine. When I use the variable rollName it fails. The other variable curDiv and rollSource work fine. Why?
I need to use a variable for the image name, how can I do this?
THIS WORKS
<style type="text/css">
#shell01 {
position: absolute;
left: 1;
}
#div01 {
position: relative;
}
</style>
<script>
function overCol01(curDiv, rollName, rollSource) {
document.layers['shell01'].layers[curDiv].document.orange01.src=rollSource;
}
</script>
<div id="shell01" id="shell01">
<div id="div01" id="div01">
<a href="#" onmouseover="overCol01('div01', 'orange01', 'orangelit.gif');"><img border="0" id="orange01" name="orange01" src="orangedark.gif"></a>
</div>
THIS DOES NOT WORK
<style type="text/css">
#shell01 {
position: absolute;
left: 1;
}
#div01 {
position: relative;
}
</style>
<script>
function overCol01(curDiv, rollName, rollSource) {
document.layers['shell01'].layers[curDiv].document.rollName.src=rollSource;
}
</script>
<div id="shell01" id="shell01">
<div id="div01" id="div01">
<a href="#" onmouseover="overCol01('div01', 'orange01', 'orangelit.gif');"><img border="0" id="orange01" name="orange01" src="orangedark.gif"></a>
</div>