At the top of the form, add the following code:
<style type='text/css'>
.button {color:green; font-weight:bold; behavior:url (js-bin\button.htc)}
</style>
Create a button on a form.
Open the properties of the button, go to the HTML tab, and assign a class
of "button" (without the quotes).
Open a simple text editor (e.g., Notepad) and copy the following
code into it.
<PUBLIC:COMPONENT>
<ATTACH EVENT="onmouseover" FOR="element" HANDLER="eventMouseOver" />
<ATTACH EVENT="onmouseout" FOR="element" HANDLER="eventMouseOut" />
<SCRIPT language="JScript">
function eventMouseOver()
{
this.style.color='red';
this.style.cursor='hand';
}
function eventMouseOut()
{
this.style.color='green';
this.style.cursor='default';
}
</SCRIPT>
</PUBLIC:COMPONENT>
Save the file to the following directory/name of your Domino server:
data/domino/html/js-bin/button.htc
(If the directory doesn't exist, create it).
Presto! You have global mouseover and mouseout events for your buttons. With very little effort you can apply this style to every button in an application.
Requires Free Membership to View
Register today to access targeted resources from our editorial writers and independent industry experts focused on Lotus Domino, Notes, Workplace and other related technologies.
This was first published in August 2001