473,403 Members | 2,323 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

change CSS class on clicking hyperlink

Hi,

On this site:
http://www.spinxo.com/

Names appear as links - e.g.:

Expand|Select|Wrap|Line Numbers
  1. <a href="...the link..."
  2. rel="nofollow" 
  3. target="blank">Zesticleum</a>
If I click a link, the white star changes to orange.

If I inspect a clicked link with FireBug, the HTML changes to:

Expand|Select|Wrap|Line Numbers
  1. <a href="...the link..."
  2. rel="nofollow"
  3. target="blank"
  4. class="active">Zesticleum</a>
I am not sure how they go about doing that, as the update is instant, it doesn't look like any ajax stuff is going on in the background, but I could be wrong.

Any advice much appreciated

Thanks
Sep 9 '12 #1
3 2254
Rabbit
12,516 Expert Mod 8TB
It's using the active pseudoclass to make the visual change.
Expand|Select|Wrap|Line Numbers
  1. UL.list01 A.active { background-image: url(dot04b.gif); }
Sep 9 '12 #2
Hi - thanks for the reply. I can see how the effect is made, it was more that I couldn't work out how the HTML of the link changed as soon as the link was clicked to include class="active"...

Thanks for your reply though :-)
Sep 10 '12 #3
Rabbit
12,516 Expert Mod 8TB
It's a psedoclass, it's automatically applied by the browser. There is no code to do it, it's built into the way a browser works.
Sep 10 '12 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: TB | last post by:
Hi All For reasons unknown to me, the Page.IsPostBack is always false when I click a link in a hyperlink column of a datagrid which is created programmatically. My code in a page called...
3
by: Vear | last post by:
Hi, I'm looking to change the cssclass on a hyperlink with the onmouseover. I've tried the 3 syntax's below but to no success. Can someone point me in the right direction. Thanks ...
9
by: loga123 | last post by:
I am using asp .net 2.0. I have a hyperlink asp control on my web page page1.aspx. On clicking this hyper;link, I would like to open page2.aspx (which is in the same web application) in a new IE...
3
by: Robert | last post by:
Hi, Is it possible to dynamically change the style of a class instead of just an individual element? If so could you point me in the right direction? Robert
8
by: menmysql | last post by:
hi to all <html> <head> <link rel="stylesheet" href="./css/Form.css"> <script language="javascript" > </script> </head>
2
by: spawnofstan | last post by:
I am trying to create a javascript that will change the color of text for the label of a form field on a the click of a button. I have come up with something, but it doesn't seem to work. Any...
4
by: =?Utf-8?B?R3JlZw==?= | last post by:
I have an <asp:HyperLinkcontrol on my master page shown as "Return" I want this control to always return to a specific page I set in code. How can I change the "NavigateUrl" value for a...
2
by: yousername | last post by:
Hello! I am totally new to JavaScript. My knowledge is barely enough to adapt some ready-made code to suit my needs. What I'm trying to accomplish now is beyond my abilities. I have looked all...
2
by: Izzy123 | last post by:
we are given a database, and we had to list the year of review, this is to be a hypertext link which when clicked will pass the reviewid(which is stored in the reviews table in the database) to the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.