Preserved Topic: Changing CSS tag via JavaScript (Page 1 of 1) |
|
---|---|
Maniac (V) Inmate From: there...no..there..... |
posted 09-10-2001 20:42
How can I change the CSS class of a link onMouseOver and onMouseDown in a link? |
Maniac (V) Mad Scientist with Finglongers From: Cell 53, East Wing |
posted 09-10-2001 20:47
I'm not sure why you'd want to do that for a link when :hover will do but use something like: |
Maniac (V) Inmate From: there...no..there..... |
posted 09-10-2001 21:40
Thanks once again Emperor. The reason I am doing this is because I am making a "ToolBar" type interface. When the mouse is over the link, it looks like "CoolButtons". When the mouse is down it will look as if the button is being pressed. |
Maniac (V) Mad Scientist with Finglongers From: Cell 53, East Wing |
posted 09-10-2001 21:51
CPrompt: I was playing around with doing it this way but I went for the WebFX code which would make it work in more browsers - I may return to the way you suggest as I keep breaking CoolButtons when I redo the page. The power of this.className is that it can provide interesting effects if you don't want to get into a full JavaScript solution but it can get a little weighty in code when you try to do something complex but as I say I'm a big fan and prefer this solution to many others. |
Maniac (V) Mad Scientist From: Belgrade, Serbia |
posted 09-10-2001 22:21 |
Maniac (V) Mad Scientist with Finglongers From: Cell 53, East Wing |
posted 09-10-2001 22:32
mr.maX - thanks for picking up that point - its an important point that I was, sort of, alluding to by stressing the need for more complex JavaScript to make it more cross-browser. This is esp. important with something like link buttons as it could prove difficult for other browser users to understand the navigation. |
Maniac (V) Inmate From: there...no..there..... |
posted 09-11-2001 03:27
Yeah, I know that this is just for IE and NS6 unfortunatley. The other bad thing is that I am redoing my personal site and it is all CSS, some of which is CSS2. This is a big problem I know but there again it is just a personal site and I beleive that everyone that will be viewing it uses IE. It is just hard to make a page that I like while being cross browser, esp. since it is just a personal site for family and friends to check out and a way for me to develop some sort of web skills. Down the road I am sure that I will change it again to something a little more browser friendly. |