Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Applying css via javascript

Status
Not open for further replies.
Jun 5, 2006
28
US
I have the following code:
<a onmousedown='test();' onmousover=''><img src='button.gif'/></a>

I want to place some code in the onmouseover to apply the following css style to to the image when a user mouses over the image.

cursor:hand;
filter: progid:DXImageTransform.Microsoft.BasicImage(grayscale=1, xray=0, mirror=0, invert=0, opacity=1, rotation=0);

Thanks.
 
You can use css for all this. You can do:

:hover for onmouseover
:link and :visited for onmouseout
and
:active for onmousedown
also
:focus might be an alternative for onmousedown, depending on how you want the script to behave.

___________________________________________________________
[small]Do something about world cancer today: PACT[/small]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top