Forum Moderators: not2easy

Message Too Old, No Replies

Visual Cue for Clicked links

Visual Cue for clikced links

         

saha_m

11:13 am on Apr 22, 2004 (gmt 0)

10+ Year Member



I got a problem today. I have a site with frames. Left frame have bunch of links. When ever a user clicking on a hyper link it will open the page in right frame. I want to provide a visual cue to the user which link the user is clicked in the left frame. I dont want to use javascript to pass the url and do some magic and also no way of using server side code. Is there is any other way i can achieve this. This is kind of urgent , if any good souls out there can help me?

Bonusbana

12:44 pm on Apr 22, 2004 (gmt 0)

10+ Year Member



I would say its impossible without javascript or server side scripting.

Rambo Tribble

1:14 pm on Apr 22, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Without a script, you're pretty much limited to the pseudo-class styles, :link, :visited, :hover, and :active.

drbrain

4:17 pm on Apr 22, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



:focus { color: red; }

photon

4:45 pm on Apr 22, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



But is
:focus
supported by IE?

photon

1:06 pm on Apr 22, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Not sure how this would work with frames, but perhaps one possibility would be to style the active link using CSS. Something along the lines of:

a:active {font-weight:bold; color:red;}

Bonusbana

1:21 pm on Apr 22, 2004 (gmt 0)

10+ Year Member



nope, the :active pseudo-class defines the link when you click it, but not after you release your mouse button. You neen some server side scripting to solve this one.

Bonusbana

3:09 pm on Apr 25, 2004 (gmt 0)

10+ Year Member



:focus defines the link when it is in focus through tabbing. It is not widely supported and it is only useable in input fields. It has nothing to do with what you are trying to achieve here.

drbrain

3:35 pm on Apr 26, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The :focus pseudo-class applies while an element has the focus (accepts keyboard events or other forms of text input).

Last I checked, an <a> element "accepts keyboard inputs".

Bonusbana: Please go test your assertions before spouting off.

Gecko based browsers focus anchor elements when you click on them, which gives the result desired by saha_m.

DrDoc

5:27 pm on Apr 26, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Though :focus may seem to work, and though it has very good support in most browsers, the problem isn't so much whether support exists or not. Instead, the big problem is, how do browsers handle this in combination with frames? My experience is that it is very unreliable. I'd recommend a different approach. Whenever you click on a link (in the navigation frame) change the class name for that link, giving it a different appearance. Then, when another link is clicked, first reset (or remove) the class name on the previous link, then change the class name on the currently clicked link. Works like a charm, and probably has the best cross browser support.

Bonusbana

10:21 pm on Apr 26, 2004 (gmt 0)

10+ Year Member



Sorry, I didnt mean to spit on anyone. All Im saying is that :focus is not the way to go, just because its not supposed to be used that way. And I must also disagree with DrDoc about the support for :focus in different browsers, only NS6, mozilla[ish] and IE5/mac support it, wich gracefully excludes 95% of our users.

Whithout server side scripting, I would do what DrDoc recommends and make a style switcher in javascript.