HighDots Forums  

Forcing an A:active status on a link

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss Forcing an A:active status on a link in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
newcomsas@hotmail.com
 
Posts: n/a

Default Forcing an A:active status on a link - 06-13-2006 , 04:15 AM






Hello.

I'm working on a problem related with CSS and javascript: I have got a
link on a page and a stylesheet file that makes the background color
change when users click on it.

Is there anyone who knows if it is possible to 'force' via javascript a
status A:active on a link ? I mean: is there a property of the style
that can make the css believe a link was clicked when in reality it was
not ?

I know one could set simply a

IDlink.backgroundColor='pink'

for instance, but I am really interested in the direct interaction with
the 'active' (or hover or a visited) state.

I thank you in advance for any help.

Newcomsas


Reply With Quote
  #2  
Old   
David Dorward
 
Posts: n/a

Default Re: Forcing an A:active status on a link - 06-13-2006 , 06:28 AM






newcomsas (AT) hotmail (DOT) com wrote:
Quote:
Is there anyone who knows if it is possible to 'force' via javascript a
status A:active on a link ?
No.

Quote:
I mean: is there a property of the style
that can make the css believe a link was clicked when in reality it was
not ?
:active means "is being clicked on" not "was clicked on".

You probably want to use :focus (although I don't think browser support
is great).

Moments after the link is cliecked, the browser goes to a new page
though, so its not going to be noticed by most people.



Reply With Quote
  #3  
Old   
Alan Silver
 
Posts: n/a

Default Re: Forcing an A:active status on a link - 06-13-2006 , 10:22 AM



In article <1150198106.824400.24360 (AT) y43g2000cwc (DOT) googlegroups.com>, David
Dorward <dorward (AT) gmail (DOT) com> writes
Quote:
Moments after the link is cliecked, the browser goes to a new page
though, so its not going to be noticed by most people.
True, but if you hit the Back button afterwards, IE will still show the
link as active. Not sure if other browsers do as well.

--
Alan Silver
(anything added below this line is nothing to do with me)


Reply With Quote
  #4  
Old   
Harlan Messinger
 
Posts: n/a

Default Re: Forcing an A:active status on a link - 06-13-2006 , 10:25 AM



David Dorward wrote:
Quote:
newcomsas (AT) hotmail (DOT) com wrote:
Is there anyone who knows if it is possible to 'force' via javascript a
status A:active on a link ?

No.

I mean: is there a property of the style
that can make the css believe a link was clicked when in reality it was
not ?

:active means "is being clicked on" not "was clicked on".

You probably want to use :focus (although I don't think browser support
is great).
Not everyone uses a mouse. When you tab through a web page, which link
or field has the focus needs to be apparent.

Quote:
Moments after the link is cliecked, the browser goes to a new page
though, so its not going to be noticed by most people.


Reply With Quote
  #5  
Old   
David Dorward
 
Posts: n/a

Default Re: Forcing an A:active status on a link - 06-13-2006 , 05:25 PM



Harlan Messinger wrote:

Quote:
You probably want to use :focus (although I don't think browser support
is great).

Not everyone uses a mouse.
I'm very aware of that.

Quote:
When you tab through a web page, which link or field has the focus needs
to be apparent.
Yes, and it would be nice if support for :focus was better - but focus is
also given to the last interactive element clicked upon, which was my
point.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is


Reply With Quote
  #6  
Old   
David Dorward
 
Posts: n/a

Default Re: Forcing an A:active status on a link - 06-13-2006 , 05:27 PM



Alan Silver wrote:

Quote:
In article <1150198106.824400.24360 (AT) y43g2000cwc (DOT) googlegroups.com>, David
Dorward <dorward (AT) gmail (DOT) com> writes
Moments after the link is cliecked, the browser goes to a new page
though, so its not going to be noticed by most people.

True, but if you hit the Back button afterwards, IE will still show the
link as active. Not sure if other browsers do as well.
Bug in IE. It isn't being activated so :active should not apply.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is


Reply With Quote
  #7  
Old   
Alan Silver
 
Posts: n/a

Default Re: Forcing an A:active status on a link - 06-14-2006 , 03:46 AM



In article <e6ne9q$fm9$1$8302bc10 (AT) news (DOT) demon.co.uk>, David Dorward
<dorward (AT) yahoo (DOT) com> writes
Quote:
Moments after the link is cliecked, the browser goes to a new page
though, so its not going to be noticed by most people.

True, but if you hit the Back button afterwards, IE will still show the
link as active. Not sure if other browsers do as well.

Bug in IE. It isn't being activated so :active should not apply.
I never said it wasn't a bug, I merely pointed out that it happens,
contrary to the claim you made that the active state is only seen for a
moment.

Ta ra

--
Alan Silver
(anything added below this line is nothing to do with me)


Reply With Quote
  #8  
Old   
Harlan Messinger
 
Posts: n/a

Default Re: Forcing an A:active status on a link - 06-14-2006 , 09:10 AM



David Dorward wrote:
Quote:
Harlan Messinger wrote:

You probably want to use :focus (although I don't think browser support
is great).

Not everyone uses a mouse.

I'm very aware of that.
I don't doubt it, but your remark, "moments after the link is clicked,
the browser goes to a new page though, so its not going to be noticed by
most people," seemed to imply that setting :focus was rather pointless,
so I wasn't sure you were thinking about its utility for the mouseless.


Reply With Quote
  #9  
Old   
David Dorward
 
Posts: n/a

Default Re: Forcing an A:active status on a link - 06-14-2006 , 11:35 AM



Harlan Messinger wrote:
Quote:
I don't doubt it, but your remark, "moments after the link is clicked,
the browser goes to a new page though, so its not going to be noticed by
most people," seemed to imply that setting :focus was rather pointless,
so I wasn't sure you were thinking about its utility for the mouseless.
The context got a bit screwed up - I meant that trying to get the
:active state to hold after the button was released was pointless.



Reply With Quote
  #10  
Old   
Jukka K. Korpela
 
Posts: n/a

Default Re: Forcing an A:active status on a link - 06-14-2006 , 02:10 PM



David Dorward <dorward (AT) gmail (DOT) com> scripsit:

Quote:
:active means "is being clicked on" not "was clicked on".
The CSS specifications define :active rather vaguely, in terms of
"activation", leaving it unspecified what constitutes activation, though
with one characterization:
"The :active pseudo-class applies while an element is being activated by the
user. For example, between the times the user presses the mouse button and
releases it."
"http://www.w3.org/TR/REC-CSS2/selector.html#x36

It is unclear whether the example indicates a case where an element _must_
be treated as active or a case where an element _might_ be treated as
active. The formulation "is being activated" seems to exclude (i.e., make
nonconforming) the IE behavior of treating a link as active after a user has
followed the link and returned.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.