• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Easy Javscript ??? Combining two functions....

jonnyGURU

Moderator <BR> Power Supplies
Moderator
I've got two functions. First one loads and iFrame with content, the second is a simple image swap:


function over(imgname,imgsrc) {
document[imgname].src=imgsrc;
}

function loadIframe(iframeName, url) {
if ( window.frames[iframeName] ) {
window.frames[iframeName].location = url;
return false;
}


I want to pull off both functions with the same OnMouseOver event. Only works in NS though. Not IE. Something wrong with my syntax?


function MO1()
{
over('4600','2420mouseon.gif');
loadIframe('ifrm', 'Avaya2420.htm');
}


The link looks like this:


<a href="Avaya4600.htm" target="ifrm" onMouseOver="MO1();" onMouseOut="out('4600','images/2420mouseoff.gif');" >
<img src="images/2420mouseoff.gif" border=0 name="4600" width=600 height=30></a>


If I replace the "MO1()" with "over('4600','2420mouseon.gif')" or with "loadIframe('ifrm', 'Avaya2420.htm')" they both work in both browsers. I only have a problem running both together.
 
1. Your function loadIframe is missing a closing curly brace }
2. I think you can call both functions in your HTML <a>nchor tag:

<a href="Avaya4600.htm" target="ifrm" onMouseOver="over('4600','2420mouseon.gif'); loadIframe('ifrm', 'Avaya2420.htm');" onMouseOut="out('4600','images/2420mouseoff.gif');" >
<img src="images/2420mouseoff.gif" border=0 name="4600" width=600 height=30></a>

Otherwise, i'm not sure about it, since i'm not all that good with javascript.... -(
 
Back
Top