Forum Moderators: not2easy

Message Too Old, No Replies

sticky hover state

         

terrybarnes

12:21 pm on Nov 16, 2007 (gmt 0)

10+ Year Member



I included this on the javascript forum but I think it's probably more of a CSS or HTML question. I also have no idea how to delete my previous post - any ideas?

Anyway here goes, I have a side menu which when you click on a link it changes the content of an iframe alongside the menu. What I'm wondering is whether it's possible to keep the hover state, of html text, in a down state until the user then clicks on another menu item?

SuzyUK

3:57 pm on Nov 16, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I see Dabrowski answered about using JS to change the class name of the clicked link, which would a way - just style the 'active' class to match the hover 'down state'..

using CSS, does styling the

:active
&
:focus
states of the link styles work for these kind iframe changes or is it not peristent, I can't remember and am just throwing it out for thought

terrybarnes

4:58 pm on Nov 16, 2007 (gmt 0)

10+ Year Member



I'm not too sure - I'll have a little play tonight and see what I manage to produce.

Xapti

1:54 am on Nov 17, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You're saying when you click a link, it will access information (likely the link) in an iframe near the menu, right? You want the link to stay style a certain way after being clicked, until another link is clicked?
Your solution resides with Javascript in my opinion, and the reasoning follows.

Someone did mention the focus pseudo-class selector (focus is persistant... the same as as when you get the dotted outline. Active is totally non-persistant.. as it has the least on time of any of the pseudo-classes, since it's only active while the mouse button is held down (it is oblivious to keyboard input, it seems)), which could likely give essentially the same effect. But as far as I know, some browsers do not support this (such as the big I E). In fact I thought most didn't support it, since you almost never see that selector being used.

[edited by: Xapti at 1:59 am (utc) on Nov. 17, 2007]