raygaz
06-28-2003, 04:44 PM
I have an onMouseover change image script working in frames for one picture out of 6.
The problem is I don't know how to specify different targets for the other 5 pictures ( they are in a table in a line)
Do I need to put 'var' in somewhere?
I have tried numbering the altimg tag of the pictures but it didn't work ??
PLEEESE help someone.
In head:
</STYLE>
<script language="JavaScript">
<!-- Hide from old browsers
if (navigator.appVersion.indexOf("2.") != -1){
check = false;
}
if ((navigator.appVersion.indexOf("3.") != -1) && (navigator.appName.indexOf("Explorer") != -1)){
check = false;
}
else {
check = true;
}
image1alt = new Image();
image1alt.src = "doorcanopy2.jpg";
image1alton = new Image();
image1alton.src = "doorcanopy1.jpg";
image2alt = new Image();
image2alt.src = "roofing1.jpg";
image2alton = new Image();
image2alton.src = "roofing.jpg";
image3alt = new Image();
image3alt.src = "Mushroom1.jpg";
image3alton = new Image();
image3alton.src = "Mushroom.jpg";
image4alt = new Image();
image4alt.src = "fittedvanback1.jpg";
image4alton = new Image();
image4alton.src = "fittedvanback.jpg";
image5alt = new Image();
image5alt.src = "moulds1.jpg";
image5alton = new Image();
image5alton.src = "moulds.jpg";
image6alt = new Image();
image6alt.src = "ingroup1.jpg";
image6alton = new Image();
image6alton.src = "ingroup.jpg";
function imageon(name) {
parent.topFrame.document.altimg.src = eval(name + "alton.src");
}
function imageoff(name) {
parent.topFrame.document.altimg.src = eval(name + "alt.src");
}
NN3 = true;
function on(name) {
if (check == true){
imageon(name);
}
}
function off(name) {
if (check == true){
imageoff(name);
}
}
// -->
</script>
In body:
<div align="left">
<p><a href="page2.html" onmouseover="on('image1');" onmouseout="off('image1')" target="mainFrame"><font face="Arial" size="2" color="#FFFFFF">.</font><font face="Arial" size="2">Architectural
Features</font></a></p>
<p><font face="Arial" size="2" color="#006633"><a href="page3.html" onmouseover="on('image2');" onmouseout="off('image2')" target="mainFrame"><font color="#FFFFFF">.</font>Flat
Roofing</a></font></p>
<p><font face="Arial" size="2" color="#006633"><a href="page4.html" onmouseover="on('image3');" onmouseout="off('image3')" target="mainFrame"><font color="#FFFFFF">.</font>Shop
Fitting &<br>
<font color="#FFFFFF">..</font>Cruise Liners</a></font></p>
<p><font face="Arial" size="2" color="#006633"><a href="page5.html" onmouseover="on('image4');" onmouseout="off('image4')" target="mainFrame"><font color="#FFFFFF">.</font>Specialist
Car &<br>
<font color="#FFFFFF">.</font>Van Conversions</a></font></p>
<p><font face="Arial" size="2" color="#006633"><a href="page6.html" onmouseover="on('image5');" onmouseout="off('image5')" target="mainFrame"><font color="#FFFFFF">.</font>What
Is GRP?</a></font></p>
<p><font face="Arial" size="2" color="#006633"><a href="page7.html" onmouseover="on('image6');" onmouseout="off('image6')" target="mainFrame"><font color="#FFFFFF">.</font>Contact
&<br>
<font color="#FFFFFF">.</font> Enquiries</a></font></p>
</div>
and in body where pics are to change (different frame)
<table width="626" border="0" height="85" align="left">
<tr>
<td width="182" height="44"><font color="#FFFFFF">..</font><img src="logo.jpg" width="154" height="58"><font color="#FFFFFF">.</font></td>
<td width="60" height="44"><img src="spacer.jpg"></td>
<td width="60" height="44"><img src="doorcanopy2.jpg" name="altimg" width="60" alt="Door Canopy"></td>
<td width="60" height="44"><a href="page3.html" target="mainFrame"><img src="roofing1.jpg" width="60" height="65" name="altimg1" border="0"></a></td>
<td width="60" height="44"><a href="page4.html" target="mainFrame"><img src="Mushroom1.jpg" width="60" height="65" name="altimg2" border="0"></a></td>
<td width="60" height="44"><a href="page5.html" target="mainFrame"><img src="fittedvanback1.jpg" width="60" height="65" name="altimg3" border="0"></a></td>
<td width="60" height="44"><a href="page6.html" target="mainFrame"><img src="moulds1.jpg" width="60" height="65" border="0" name="altimg4"></a></td>
<td width="64" height="44"><a href="page7.html" target="mainFrame"><img src="ingroup1.jpg" width="60" height="65" name="altimg5" border="0"></a></td>
</tr>
thanx:D
The problem is I don't know how to specify different targets for the other 5 pictures ( they are in a table in a line)
Do I need to put 'var' in somewhere?
I have tried numbering the altimg tag of the pictures but it didn't work ??
PLEEESE help someone.
In head:
</STYLE>
<script language="JavaScript">
<!-- Hide from old browsers
if (navigator.appVersion.indexOf("2.") != -1){
check = false;
}
if ((navigator.appVersion.indexOf("3.") != -1) && (navigator.appName.indexOf("Explorer") != -1)){
check = false;
}
else {
check = true;
}
image1alt = new Image();
image1alt.src = "doorcanopy2.jpg";
image1alton = new Image();
image1alton.src = "doorcanopy1.jpg";
image2alt = new Image();
image2alt.src = "roofing1.jpg";
image2alton = new Image();
image2alton.src = "roofing.jpg";
image3alt = new Image();
image3alt.src = "Mushroom1.jpg";
image3alton = new Image();
image3alton.src = "Mushroom.jpg";
image4alt = new Image();
image4alt.src = "fittedvanback1.jpg";
image4alton = new Image();
image4alton.src = "fittedvanback.jpg";
image5alt = new Image();
image5alt.src = "moulds1.jpg";
image5alton = new Image();
image5alton.src = "moulds.jpg";
image6alt = new Image();
image6alt.src = "ingroup1.jpg";
image6alton = new Image();
image6alton.src = "ingroup.jpg";
function imageon(name) {
parent.topFrame.document.altimg.src = eval(name + "alton.src");
}
function imageoff(name) {
parent.topFrame.document.altimg.src = eval(name + "alt.src");
}
NN3 = true;
function on(name) {
if (check == true){
imageon(name);
}
}
function off(name) {
if (check == true){
imageoff(name);
}
}
// -->
</script>
In body:
<div align="left">
<p><a href="page2.html" onmouseover="on('image1');" onmouseout="off('image1')" target="mainFrame"><font face="Arial" size="2" color="#FFFFFF">.</font><font face="Arial" size="2">Architectural
Features</font></a></p>
<p><font face="Arial" size="2" color="#006633"><a href="page3.html" onmouseover="on('image2');" onmouseout="off('image2')" target="mainFrame"><font color="#FFFFFF">.</font>Flat
Roofing</a></font></p>
<p><font face="Arial" size="2" color="#006633"><a href="page4.html" onmouseover="on('image3');" onmouseout="off('image3')" target="mainFrame"><font color="#FFFFFF">.</font>Shop
Fitting &<br>
<font color="#FFFFFF">..</font>Cruise Liners</a></font></p>
<p><font face="Arial" size="2" color="#006633"><a href="page5.html" onmouseover="on('image4');" onmouseout="off('image4')" target="mainFrame"><font color="#FFFFFF">.</font>Specialist
Car &<br>
<font color="#FFFFFF">.</font>Van Conversions</a></font></p>
<p><font face="Arial" size="2" color="#006633"><a href="page6.html" onmouseover="on('image5');" onmouseout="off('image5')" target="mainFrame"><font color="#FFFFFF">.</font>What
Is GRP?</a></font></p>
<p><font face="Arial" size="2" color="#006633"><a href="page7.html" onmouseover="on('image6');" onmouseout="off('image6')" target="mainFrame"><font color="#FFFFFF">.</font>Contact
&<br>
<font color="#FFFFFF">.</font> Enquiries</a></font></p>
</div>
and in body where pics are to change (different frame)
<table width="626" border="0" height="85" align="left">
<tr>
<td width="182" height="44"><font color="#FFFFFF">..</font><img src="logo.jpg" width="154" height="58"><font color="#FFFFFF">.</font></td>
<td width="60" height="44"><img src="spacer.jpg"></td>
<td width="60" height="44"><img src="doorcanopy2.jpg" name="altimg" width="60" alt="Door Canopy"></td>
<td width="60" height="44"><a href="page3.html" target="mainFrame"><img src="roofing1.jpg" width="60" height="65" name="altimg1" border="0"></a></td>
<td width="60" height="44"><a href="page4.html" target="mainFrame"><img src="Mushroom1.jpg" width="60" height="65" name="altimg2" border="0"></a></td>
<td width="60" height="44"><a href="page5.html" target="mainFrame"><img src="fittedvanback1.jpg" width="60" height="65" name="altimg3" border="0"></a></td>
<td width="60" height="44"><a href="page6.html" target="mainFrame"><img src="moulds1.jpg" width="60" height="65" border="0" name="altimg4"></a></td>
<td width="64" height="44"><a href="page7.html" target="mainFrame"><img src="ingroup1.jpg" width="60" height="65" name="altimg5" border="0"></a></td>
</tr>
thanx:D