Interactive buttons on a Web page do not display the correct image when you click or rest the pointer over the button in FrontPage 2003 (817123)



The information in this article applies to:

  • Microsoft Office FrontPage 2003

SYMPTOMS

In FrontPage 2003, Web pages contain a set of interactive buttons that link to other Web pages. However, the interactive buttons never appear to be "pressed" or active. This means that you cannot determine which page is active because each button appears to be in the same (not pressed) state.

RESOLUTION

To work around this issue, edit the button script. To do so, use one of the following methods.

Method 1: Edit the Path of the Button to Point to the Correct Image of the Button

  1. Double-click the button, and then click the Image tab.
  2. Click to select the following check boxes:
    • Create hover image
    • Create pressed image
    • Preload button images
    This step creates and saves a copy of three separate images of each button that is created: the hover image, the pressed image, and the default image (not pressed).
  3. Click OK.
  4. Click Code in the lower-left corner to edit the code.
  5. Locate the code that is similar to the following, where File Path is the file that contains the image of the button:
    onmousedown="FP_swapImg(1,0,/*id*/'img1',/*url*/'file:File Path"
  6. Edit the file path to point to the file that contains the image of the "pressed" button that was created in step 2.

Method 2: Add Script to the Buttons

  1. Add the following code block under <script> in the <head> section of your HTML document:
    function pressBtnIfActive( id )
    {
     id = "document.getElementById('" + id + "')";
    
     if( !document.getElementById ||
      !document.body.parentNode ||
      !eval( id ) )
      return;
    
     if( document.location == eval( id + ".parentNode.href" ) )
     {
      eval( id + ".onmousedown()" );
      eval( id + ".onmousedown=null" );
      eval( id + ".onmouseover=null" );
      eval( id + ".onmouseout=null" );
     eval( id + ".onmouseup=null" );
     }
    }
    
  2. Add the following code block to the <body> section of your HTML document under the following line of code, where Image 1 and Image 2 are the file names that the button images are saved under:
    FP_Preload()
    pressBtnIfActive( Image 1 ); 
    pressBtnIfActive( Image 2 );
  3. Save your changes, and then click the interactive button.
Microsoft has confirmed that this is a bug in the Microsoft products that are listed in the "Applies to" section.

Modification Type:MinorLast Reviewed:9/27/2006
Keywords:kbcode kbhtml kbBug KB817123