craig
08-18-2002, 06:13 PM
I am trying to create a menu that renders mouseover images and displays a window.status message as well.
The following code is what I am trying to use.
I have other code already in the source for my web page but would like to tighten it up in hopes that the window.status will then work in netscape as well as IE.
This is the website address that is currently using the older code.
ProAm Rodeo.com (http://www.proamrodeo.com)
I have done the following.
(1) Defined variable winStat for array
(2) Structured the array
(3) Looped the images and text(?)
(4) Defined the function dowinStat
(5) Placed the return command in the display HTML
The follwoing is the code I have been trying to use. What am I mising?
<HTML>
<HEAD>
<TITLE></TITLE>
<META name="description" content="">
<META name="keywords" content="">
<script language="javascript" type="text/javascript">
<!--
/*
* Pre-load the specified image. This loads the image as the page
* loads, so that when it is used later (such as for a mouseover effect),
* the image has already been loaded. It includes the window status text
*/
// (1) Window Status content goes here (image, window status)
(1) var winStat = new Array();
// multi-dimensional arrays containing:
// mouseover images and text for window status
(2) //Menu Button
winStat[0] = new Array('http://www.proamrodeo.com/gif/menu/Menu-over.gif','Click For Expanded Menu.');
winStat[1] = new Array('http://www.proamrodeo.com/gif/menu/Menu-down.gif','Click For Expanded Menu.');
winStat[2] = new Array('http://www.proamrodeo.com/gif/menu/Menu.gif','');
//About_Us Button
winStat[3] = new Array('http://www.proamrodeo.com/gif/menu/About_Us-over.gif','Meet Our Board Of Directors and Membership Affilates');
winStat[4] = new Array('http://www.proamrodeo.com/gif/menu/About_Us-down.gif','Meet Our Board Of Directors and Membership Affiliates');
winStat[5] = new Array('http://www.proamrodeo.com/gif/menu/About_Us.gif','');
(3) // preload images that are to appear in tooltip
// from arrays above
if (document.images) {
var thewinStats = new Array();
for (var i=0; i<winStat.length; i++) {
thewinStats[i] = new Image();
thewinStats[i].src = winStat[i][0];
}
}
(4) //function to display menu images
function dowinStat(img,stat){
window.status= winStat[stat][1];
document.images[img].src = winStat[stat][0];
return true;
//-->
</script>
</HEAD>
<BODY>
(5) <DIV STYLE="position:absolute; top:260px; left:340px; width:90px; border-width:0; visibility: visible; z-index:1">
<a href="javascript:void(0);"
onMouseOver="return dowinStat(Menu,0);"
onMouseOut="return dowinStat(Menu,2);"
onMouseDown="return dowinStat(Menu,1);"
onMouseUp="return dowinStat(Menu,0);">
<img name="Menu" src="./Menu.gif" width="88" height="38" vspace="0" border="0" alt="Menu"></a><br>
</DIV>
<DIV STYLE="position:absolute; top:230px; left:540px; width:90px; border-width:0; visibility:visible; z-index:1">
<a href="javascript:void(0);"
onMouseOver="return dowinStat(About_Us,3);"
onMouseOut="return dowinStat(About_Us,5);"
onMouseDown="return dowinStat(About_Us,4);"
onMouseUp="return dowinStat(About_Us,3);">
<img name="About_Us" src="./About_Us.gif" width="90" height="40" vspace="0" border="0" alt="About Us"></a><br>
</BODY>
</html>
The following code is what I am trying to use.
I have other code already in the source for my web page but would like to tighten it up in hopes that the window.status will then work in netscape as well as IE.
This is the website address that is currently using the older code.
ProAm Rodeo.com (http://www.proamrodeo.com)
I have done the following.
(1) Defined variable winStat for array
(2) Structured the array
(3) Looped the images and text(?)
(4) Defined the function dowinStat
(5) Placed the return command in the display HTML
The follwoing is the code I have been trying to use. What am I mising?
<HTML>
<HEAD>
<TITLE></TITLE>
<META name="description" content="">
<META name="keywords" content="">
<script language="javascript" type="text/javascript">
<!--
/*
* Pre-load the specified image. This loads the image as the page
* loads, so that when it is used later (such as for a mouseover effect),
* the image has already been loaded. It includes the window status text
*/
// (1) Window Status content goes here (image, window status)
(1) var winStat = new Array();
// multi-dimensional arrays containing:
// mouseover images and text for window status
(2) //Menu Button
winStat[0] = new Array('http://www.proamrodeo.com/gif/menu/Menu-over.gif','Click For Expanded Menu.');
winStat[1] = new Array('http://www.proamrodeo.com/gif/menu/Menu-down.gif','Click For Expanded Menu.');
winStat[2] = new Array('http://www.proamrodeo.com/gif/menu/Menu.gif','');
//About_Us Button
winStat[3] = new Array('http://www.proamrodeo.com/gif/menu/About_Us-over.gif','Meet Our Board Of Directors and Membership Affilates');
winStat[4] = new Array('http://www.proamrodeo.com/gif/menu/About_Us-down.gif','Meet Our Board Of Directors and Membership Affiliates');
winStat[5] = new Array('http://www.proamrodeo.com/gif/menu/About_Us.gif','');
(3) // preload images that are to appear in tooltip
// from arrays above
if (document.images) {
var thewinStats = new Array();
for (var i=0; i<winStat.length; i++) {
thewinStats[i] = new Image();
thewinStats[i].src = winStat[i][0];
}
}
(4) //function to display menu images
function dowinStat(img,stat){
window.status= winStat[stat][1];
document.images[img].src = winStat[stat][0];
return true;
//-->
</script>
</HEAD>
<BODY>
(5) <DIV STYLE="position:absolute; top:260px; left:340px; width:90px; border-width:0; visibility: visible; z-index:1">
<a href="javascript:void(0);"
onMouseOver="return dowinStat(Menu,0);"
onMouseOut="return dowinStat(Menu,2);"
onMouseDown="return dowinStat(Menu,1);"
onMouseUp="return dowinStat(Menu,0);">
<img name="Menu" src="./Menu.gif" width="88" height="38" vspace="0" border="0" alt="Menu"></a><br>
</DIV>
<DIV STYLE="position:absolute; top:230px; left:540px; width:90px; border-width:0; visibility:visible; z-index:1">
<a href="javascript:void(0);"
onMouseOver="return dowinStat(About_Us,3);"
onMouseOut="return dowinStat(About_Us,5);"
onMouseDown="return dowinStat(About_Us,4);"
onMouseUp="return dowinStat(About_Us,3);">
<img name="About_Us" src="./About_Us.gif" width="90" height="40" vspace="0" border="0" alt="About Us"></a><br>
</BODY>
</html>