HighDots Forums  

Forcing an A:active status on a link

alt.html.dhtml alt.html.dhtml


Discuss Forcing an A:active status on a link in the alt.html.dhtml forum.



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

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






Hello.
I'm trying to solve a problem related to DHTML and CSS.
I produced an HTML page with several links and buttuns.
I then created a CSS file in order to display a yellow background when
a link is clicked by users.

UL.menu1 LI A:active{
BACKGROUND: yellow; COLOR: black

Naturally, having acted on the A:active property, when a link is
clicked, all the others lose the yellow background.
The fact is that my page have to reload frequently. The effect I'd like
to obtain is that, when the page reloads, the link that was 'active'
before reloading continued to show the yellow background.
Having the chance of retrieving the link ID, I tried to force this
status using a simple js line

activeLinkID.click();

at the body onload event. The click was executed but the yellow
background did not appear.

Is there a way to force an 'active' status via DHTML on the link ?

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-09-2006 , 03:11 PM






newcomsas (AT) hotmail (DOT) com wrote:

Quote:
UL.menu1 LI A:active{
BACKGROUND: yellow; COLOR: black

Naturally, having acted on the A:active property, when a link is
clicked, all the others lose the yellow background.
Of course. :active means "While the mouse button is depressed while over the
link", although Internet Explorer is a bit buggy here IIRC.

The user can hardly be clicking on multiple links at the same time.

Quote:
The fact is that my page have to reload frequently. The effect I'd like
to obtain is that, when the page reloads, the link that was 'active'
before reloading continued to show the yellow background.
Sounds like you want :target, not :active. Of course :target is only a CSS 3
proposal at present, so browser support is really weak.
http://dorward.me.uk/software/frag/ is a JavaScript that has a similar
effect.

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


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.