finnstone
02-20-2003, 06:47 PM
I have a simple mouseover effect. The buttons that I am maniupulating have 2 instances, one where they are off, and one where they are on. When the user puts the mouse over the button, the on picture comes up perfect on the web. Whats the problem.....
I want the on picture to stay on if the page corresponding to the button is open ! It will not . In other words imagine this scenario with the follwoing menu
CONTACTS SERVICES PRODUCTS SCHLIZ
The person puts the mouse over products, PRODUCTS lights up, the user clicks products, the user is directed to the products page, NOW.... the user decides he wants to learn more about products on the page so he moves the mouse above a product on the page. The instant the mouse leaves the PRODUCTS button, it turns off to the off instance.
I am ovbviously missing some code or didnt include somthing because this function is not happening. PLEASE HELP!!
HERE IS THE BASIC CODE that you need to know to solve this problme
<script language="JavaScript">
if (document.images) {
var quality_Depton = new Image();
quality_Depton.src="images/about_us_on.gif";
var quality_Deptoff = new Image();
quality_Deptoff.src = "images/about_us_off1.gif";
var our_teamon = new Image();
our_teamon.src="images/our_team_on.gif";
var our_teamoff = new Image();
our_teamoff.src = "images/our_team_off2.gif";
var six_sigmaon = new Image();
six_sigmaon.src="images/six_sigma_on.gif";
var six_sigmaoff = new Image();
six_sigmaoff.src = "images/six_sigma_off.gif";
var Projectson = new Image();
Projectson.src="images/projects_on.gif";
var Projectsoff = new Image();
Projectsoff.src = "images/projects_off.gif";
var linkson = new Image();
linkson.src="images/links_on.gif";
var linksoff = new Image();
linksoff.src = "images/links_off.gif";
var contact_uson = new Image();
contact_uson.src="images/contact_us_on.gif";
var contact_usoff = new Image();
contact_usoff.src = "images/contact_us_off1.gif";
}
function imgOn(imageName) {
if (document.images) {
document[imageName].src = eval(imageName + "on.src");
}
}
function imgOff(imageName) {
if (document.images) {
document[imageName].src = eval(imageName + "off.src");
}
}
// -->
</script>
</HEAD>
NOW THE BUTTON CALLING CODE
<TD><IMG SRC="images/blank.gif" WIDTH="335" HEIGHT="20" BORDER="0"><A HREF="Quality Dep't.html"><IMG SRC="images/about_us_off1.gif" WIDTH="68" HEIGHT="20" BORDER="0" ALT="Quality Dep't" NAME="quality_Dept" onMouseOver="imgOn('quality_Dept')" ONMOUSEOUT="imgOff('quality_Dept')"></A><IMG SRC="images/blank.gif" WIDTH="33" HEIGHT="20" BORDER="0"><A HREF="our_team.html"><IMG SRC="images/our_team_off2.gif" WIDTH="98" HEIGHT="20" BORDER="0" ALT="Our Team" NAME="our_team" onMouseOver="imgOn('our_team')" ONMOUSEOUT="imgOff('our_team')"></A><IMG SRC="images/blank.gif" WIDTH="33" HEIGHT="20" BORDER="0"><A HREF="six sigma.html"><IMG SRC="images/six_sigma_on.gif" WIDTH="94" HEIGHT="20" BORDER="0" ALT="Six sigma" NAME="six_sigma" onMouseOver="imgOn('six_sigma')" ONMOUSEOUT="imgOff('six_sigma')"></A><IMG SRC="images/blank.gif" WIDTH="33" HEIGHT="20" BORDER="0"><A HREF="projects.html"><IMG SRC="images/projects_off.gif" WIDTH="89" HEIGHT="20" BORDER="0" ALT="Projects" NAME="Projects" onMouseOver="imgOn('Projects')" ONMOUSEOUT="imgOff('Projects')"></A><IMG SRC="images/blank.gif" WIDTH="30" HEIGHT="20" BORDER="0"><A HREF="links.html"><IMG SRC="images/links_off.gif" WIDTH="57" HEIGHT="20" BORDER="0" ALT="links" NAME="links" onMouseOver="imgOn('links')" ONMOUSEOUT="imgOff('links')"></A><IMG SRC="images/blank.gif" WIDTH="33" HEIGHT="20" BORDER="0"><A HREF="contact_us.html"><IMG SRC="images/contact_us_off1.gif" WIDTH=90" HEIGHT="20" BORDER="0" ALT="Contact Us" NAME="contact_us" onMouseOver="imgOn('contact_us')" ONMOUSEOUT="imgOff('contact_us')"></A></TD>
I want the on picture to stay on if the page corresponding to the button is open ! It will not . In other words imagine this scenario with the follwoing menu
CONTACTS SERVICES PRODUCTS SCHLIZ
The person puts the mouse over products, PRODUCTS lights up, the user clicks products, the user is directed to the products page, NOW.... the user decides he wants to learn more about products on the page so he moves the mouse above a product on the page. The instant the mouse leaves the PRODUCTS button, it turns off to the off instance.
I am ovbviously missing some code or didnt include somthing because this function is not happening. PLEASE HELP!!
HERE IS THE BASIC CODE that you need to know to solve this problme
<script language="JavaScript">
if (document.images) {
var quality_Depton = new Image();
quality_Depton.src="images/about_us_on.gif";
var quality_Deptoff = new Image();
quality_Deptoff.src = "images/about_us_off1.gif";
var our_teamon = new Image();
our_teamon.src="images/our_team_on.gif";
var our_teamoff = new Image();
our_teamoff.src = "images/our_team_off2.gif";
var six_sigmaon = new Image();
six_sigmaon.src="images/six_sigma_on.gif";
var six_sigmaoff = new Image();
six_sigmaoff.src = "images/six_sigma_off.gif";
var Projectson = new Image();
Projectson.src="images/projects_on.gif";
var Projectsoff = new Image();
Projectsoff.src = "images/projects_off.gif";
var linkson = new Image();
linkson.src="images/links_on.gif";
var linksoff = new Image();
linksoff.src = "images/links_off.gif";
var contact_uson = new Image();
contact_uson.src="images/contact_us_on.gif";
var contact_usoff = new Image();
contact_usoff.src = "images/contact_us_off1.gif";
}
function imgOn(imageName) {
if (document.images) {
document[imageName].src = eval(imageName + "on.src");
}
}
function imgOff(imageName) {
if (document.images) {
document[imageName].src = eval(imageName + "off.src");
}
}
// -->
</script>
</HEAD>
NOW THE BUTTON CALLING CODE
<TD><IMG SRC="images/blank.gif" WIDTH="335" HEIGHT="20" BORDER="0"><A HREF="Quality Dep't.html"><IMG SRC="images/about_us_off1.gif" WIDTH="68" HEIGHT="20" BORDER="0" ALT="Quality Dep't" NAME="quality_Dept" onMouseOver="imgOn('quality_Dept')" ONMOUSEOUT="imgOff('quality_Dept')"></A><IMG SRC="images/blank.gif" WIDTH="33" HEIGHT="20" BORDER="0"><A HREF="our_team.html"><IMG SRC="images/our_team_off2.gif" WIDTH="98" HEIGHT="20" BORDER="0" ALT="Our Team" NAME="our_team" onMouseOver="imgOn('our_team')" ONMOUSEOUT="imgOff('our_team')"></A><IMG SRC="images/blank.gif" WIDTH="33" HEIGHT="20" BORDER="0"><A HREF="six sigma.html"><IMG SRC="images/six_sigma_on.gif" WIDTH="94" HEIGHT="20" BORDER="0" ALT="Six sigma" NAME="six_sigma" onMouseOver="imgOn('six_sigma')" ONMOUSEOUT="imgOff('six_sigma')"></A><IMG SRC="images/blank.gif" WIDTH="33" HEIGHT="20" BORDER="0"><A HREF="projects.html"><IMG SRC="images/projects_off.gif" WIDTH="89" HEIGHT="20" BORDER="0" ALT="Projects" NAME="Projects" onMouseOver="imgOn('Projects')" ONMOUSEOUT="imgOff('Projects')"></A><IMG SRC="images/blank.gif" WIDTH="30" HEIGHT="20" BORDER="0"><A HREF="links.html"><IMG SRC="images/links_off.gif" WIDTH="57" HEIGHT="20" BORDER="0" ALT="links" NAME="links" onMouseOver="imgOn('links')" ONMOUSEOUT="imgOff('links')"></A><IMG SRC="images/blank.gif" WIDTH="33" HEIGHT="20" BORDER="0"><A HREF="contact_us.html"><IMG SRC="images/contact_us_off1.gif" WIDTH=90" HEIGHT="20" BORDER="0" ALT="Contact Us" NAME="contact_us" onMouseOver="imgOn('contact_us')" ONMOUSEOUT="imgOff('contact_us')"></A></TD>