Closed Thread Icon

Topic awaiting preservation: a:hover properties, accessible with javascript? (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=8932" title="Pages that link to Topic awaiting preservation: a:hover properties, accessible with javascript? (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: a:hover properties, accessible with javascript? <span class="small">(Page 1 of 1)</span>\

 
smonkey
Paranoid (IV) Inmate

From: Northumberland, England
Insane since: Apr 2003

posted posted 11-03-2003 14:01

Hi,

I am working on a site with css rollovers, it all works fine but I wanted to add an extra feature - when you click on a link (which has css hover properties) those css hover propeties are changed so that now when you hover over the link the hover state is different to how it was before.

I would ideally like a proper way to access the css a:hover rather than just replacing it with an onmouseover event - is it possible?

visit my CryoKinesis Online Gallery

Hugh
Paranoid (IV) Inmate

From: Dublin, Ireland
Insane since: Jul 2000

posted posted 11-04-2003 00:06

Would like to know also. Any chance you know how to make the a:hover different in different divs/tables using only css?

smonkey
Paranoid (IV) Inmate

From: Northumberland, England
Insane since: Apr 2003

posted posted 11-04-2003 01:43
quote:
Any chance you know how to make the a:hover different in different divs/tables using only css?



Yes I do thank you.


...it is not a javascript issue either.


...I'm guessing you'd like to know how to do it huh?


It's simple, you basically have to specify thing like this:

table a:hover { //this will affect links in table only }

div a:hover { //this will affect links in divs only }

#myBox a:hover { //this will affect links in the element with the id 'myBox' only }

.myLinks a:hover { //this will affect links in an element with the class 'myLinks' only }

table.myLinks div#myBox a:hover { //this will affect links in a div with the id of 'myBox' that is contained within a table with the class of 'myLinks' }


I hope that has cleared it up for you, now back to my problem


visit my CryoKinesis Online Gallery

Scott
Bipolar (III) Inmate

From: schillmania.com
Insane since: Jul 2002

posted posted 11-04-2003 05:55

Only thing I can think of is a:visited or a:active .. look up other pseudo-states on anchor tags though, that'd be presumably where you may find what you're looking for.

poi
Paranoid (IV) Inmate

From: France
Insane since: Jun 2002

posted posted 11-04-2003 07:38

You could alter the link's class.

code:
<a href="#" class="initialClass"  onclick="this.className+=' additionnalClass'">blah</a>

You can manipulate the className property at will to make for instance a toggle behavior.

Hope that helps,

Mathieu "POÏ" HENRI

[This message has been edited by poi (edited 11-04-2003).]

Hugh
Paranoid (IV) Inmate

From: Dublin, Ireland
Insane since: Jul 2000

posted posted 11-06-2003 12:26

thanks !

« BackwardsOnwards »

Show Forum Drop Down Menu