Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

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


View products that this article applies to.

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.

↑ Back to the top


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.

↑ Back to the top


Keywords: KB817123, kbbug, kbhtml, kbcode

↑ Back to the top

Article Info
Article ID : 817123
Revision : 6
Created on : 2/1/2007
Published on : 2/1/2007
Exists online : False
Views : 452