File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes Mouseovers and CSS Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Mouseovers and CSS" Watch "Mouseovers and CSS" New topic
Author

Mouseovers and CSS

Dale DeMott
Ranch Hand

Joined: Nov 02, 2000
Posts: 515
Here's something for you to ponder. I have created buttons with CSS. Yes .. Cascading Style Sheets. It was a nice way to create buttons w/out having to create images for every single button I had. I then created a mouseover javascript method that would change the className when the mouse went over the object. This effectivly changed the color of the button when you were over it. Problem is, ie 5.5 doesn't work anymore with this. The mouseover works as well as the mouseout. I think the issue is that I can't dynamically change the class name of the style sheet anymore. Any ideas... (besides creating an image for every button I have) Is there an easy way to change the color of these stylesheets buttons when I mouseover them??? Tell me what you think.
Thanks
Dale
------------------
By failing to prepare, you are preparing to fail.
Benjamin Franklin (1706 - 1790)


By failing to prepare, you are preparing to fail.<br />Benjamin Franklin (1706 - 1790)
Brian Glodde
Ranch Hand

Joined: Jun 27, 2001
Posts: 171
You can use "this.style.backgroundColor" to change the background of the div onmouseover/mouseout. You might have some issues with Netscape, but it all depends on the application. You can change most elements this way, so you wouldn't have to swap classnames at all.
onmouseover="this.style.backgroundColor='#CC0000';"
onmouseout="this.style.backgroundColor='#0000CC';"
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Mouseovers and CSS