Microsoft KB Archive/222949

= How to create hover effects for form buttons using DHTML and CSS in FrontPage =

Article ID: 222949

Article Last Modified on 1/24/2007

-

APPLIES TO


 * Microsoft FrontPage 2000 Standard Edition
 * Microsoft FrontPage 2002 Standard Edition

-



This article was previously published under Q222949



SUMMARY
FrontPage 2000 and FrontPage 2002 contain a rich set of Cascading Style Sheet (CSS) and Dynamic HTML (DHTML) authoring capabilities that allow you to create a variety of hover effects. This article describes you can create hover button effects for regular form field buttons by using the CSS features and DHTML formatting.



MORE INFORMATION
To create hover button effects for Form Field buttons, follow these steps:  Create a new, blank page. On the Insert menu, point to Form, and click Form. To apply default "Submit" button colors, follow these steps:

 Right-click the Submit button, and click Form Field Properties. Click Style. Click Format, and then Border. Click the Shading tab.</li> Click to select a color in the Foreground color and Background color lists.</li> Click OK three times to return to the document.</li></ol> </li> To insert DHTML hover colors, follow these steps:

<ol style="list-style-type: lower-alpha;"> Click the Submit button.</li> On the Format menu, click Dynamic HTML Effects.</li> In the On list, click to select Mouse Over.</li> In the Apply list, click to select Formatting.</li> Click to select Choose Border in the list to the right of the Apply list.</li> Click the Shading tab.</li> Click to select a color in the Foreground color and Background color lists.</li> Click OK, and close the DHTML Effects toolbar.</li></ol> </li> To move the hover colors to the Submit button, follow these steps:

<ol style="list-style-type: lower-alpha;"> Switch to HTML view.</li>  In HTML view, move the following code from the   tag to the to your   tag: dynamicanimation="fpAnimformatRolloverFP1" fprolloverstyle="background-color: #000000; color: #FFFFFF" onmouseover="rollIn(this)" onmouseout="rollOut(this)" language="Javascript1.2" Note: The values for "background-color" and "color" may be different from those shown in the previous code. </li></ol> </li> If you want, repeat the last few steps for the Reset button.</li> <li> When you have completed the previous steps, your HTML code may look similar to the following HTML code example: <input type="submit" value="Submit" style="background-color: #008000; color: #000000" dynamicanimation="fpAnimformatRolloverFP1" fprolloverstyle="background-color: #000080; color: #FFFFFF" onmouseover="rollIn(this)" onmouseout="rollOut(this)" language="Javascript1.2">

<input type="reset" value="Reset" style="background-color: #800000; color: #FFFFFF" dynamicanimation="fpAnimformatRolloverFP1" fprolloverstyle="background-color: #000080; color: #FFFFFF" onmouseover="rollIn(this)" onmouseout="rollOut(this)" language="Javascript1.2"> </li> <li>Save this page to your Desktop as "HoverTest.htm" and minimize FrontPage.</li> <li>You will notice that FrontPage saved the following two files to your Desktop:

<ul> <li>HoverTest.htm.</li> <li>Animate.js.</li></ul>

The first file is the page you created in the previous steps, the second file is a collection of DHTML functions that the page will use.</li> <li>Open "HoverTest.htm" in Internet Explorer 4.0 or later. Notice that as you move your mouse over each button, you should see the color change</li></ol>

Additional query words: front page dhtml html css

Keywords: kbbutton kbprogramming kbscript kbforms kbhowto KB222949

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.