...

View Full Version : Basic ELSE problem



not_a_guru
09-15-2005, 02:49 AM
Hello Trendsetters,

As you will see there is a basic IF/ELSE operation in the onMouseOver event. I am delaing with a frameset, and when home.cfm is loaded into mainFrame I want a layer to become visible. When any other page is loaded into the mianFrame, I want a layer to become visible in the pages own frame (leftFrame). The IF operator works, but the ELSE operator does not. Here is the code for the button:



<a href="#"

onMouseDown="MM_swapImage('loveit','','../../images/buttons/loveit.jpg',1)"

onMouseUp="MM_swapImage('loveit','','../../images/buttons/loveit_over.jpg',1)"

onMouseOut="MM_swapImgRestore()"

onMouseOver="MM_swapImage('loveit','','../../images/buttons/loveit_over.jpg',1);
MM_showHideLayers('affordbox?mainFrame','','hide');
MM_showHideLayers('searchbox?mainFrame','','hide');

if (top.mainFrame.location.href.match(/home.cfm/))
{
MM_showHideLayers('loveit2?mainFrame','','show')
}
else
{
MM_showHideLayers('search?leftFrame','','show')
}">
<img src="../../images/buttons/loveit.jpg" alt="alt text" name="loveit" width="127" height="44" border="0"></a>

Philip M
09-15-2005, 09:06 AM
if (top.mainFrame.location.href.match(/home.cfm/))
{
MM_showHideLayers('loveit2?mainFrame','','show'); //semi-colon mandatory
else
MM_showHideLayers('search?leftFrame','','show');
}



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum