Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Sep 2005
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation Basic ELSE problem

    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>

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,919
    Thanks
    203
    Thanked 2,531 Times in 2,509 Posts
    if (top.mainFrame.location.href.match(/home.cfm/))
    {
    MM_showHideLayers('loveit2?mainFrame','','show'); //semi-colon mandatory
    else
    MM_showHideLayers('search?leftFrame','','show');
    }


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •