S
simchajoy2000
Hi,
I am just a javascript beginner so maybe this is a simple problem but I
am trying to do some rollovers on images in a separate <div>. Here is
the relevent piece of my code:
<html>
<head>
<script type="text/javascript">
if (document.images) {
a_1 = new Image;
a_1.src = "DesignedImages\header.jpg";
b_1 = new Image;
b_1.src = "DesignedImages\line6.jpg";
}
function showImg(imgname, rollname)
{
var obja = parent.document.getElementById("roll_a");
var objb = parent.document.getElementById("roll_b");
if (document.images) {
window.onerror = null;
document.getElementById(rollname).src=eval(imgname +
".src");
}
}
</script>
</head>
<body>
<div id="topOrganizer">
<div id="top" align="center">
<img src="DesignedImages\header.jpg" id="roll_a">
</div>
<div id="line1">
<img src="DesignedImages\line5.jpg" id="roll_b">
</div>
</div>
<div id="header">
<div id="links">
<ul id="rolllist">
<li><a href="Peterson.html"
onmouseover="showImg('a_1','obja');showImg('b_1','objb')"><b>REPRESENTATIVE
PROJECTS</b></a> <img src="DesignedImages/button.jpg"></li>
</ul>
</div>
</body>
Due to the rather complicated nature of the design I really want to
keep using divs rather than a table but I really need to get the
rollover to work as well. I just keep getting an error that it can't
find the image object.
Can anyone help me?
Thanks!
Joy
I am just a javascript beginner so maybe this is a simple problem but I
am trying to do some rollovers on images in a separate <div>. Here is
the relevent piece of my code:
<html>
<head>
<script type="text/javascript">
if (document.images) {
a_1 = new Image;
a_1.src = "DesignedImages\header.jpg";
b_1 = new Image;
b_1.src = "DesignedImages\line6.jpg";
}
function showImg(imgname, rollname)
{
var obja = parent.document.getElementById("roll_a");
var objb = parent.document.getElementById("roll_b");
if (document.images) {
window.onerror = null;
document.getElementById(rollname).src=eval(imgname +
".src");
}
}
</script>
</head>
<body>
<div id="topOrganizer">
<div id="top" align="center">
<img src="DesignedImages\header.jpg" id="roll_a">
</div>
<div id="line1">
<img src="DesignedImages\line5.jpg" id="roll_b">
</div>
</div>
<div id="header">
<div id="links">
<ul id="rolllist">
<li><a href="Peterson.html"
onmouseover="showImg('a_1','obja');showImg('b_1','objb')"><b>REPRESENTATIVE
PROJECTS</b></a> <img src="DesignedImages/button.jpg"></li>
</ul>
</div>
</body>
Due to the rather complicated nature of the design I really want to
keep using divs rather than a table but I really need to get the
rollover to work as well. I just keep getting an error that it can't
find the image object.
Can anyone help me?
Thanks!
Joy