473,782 Members | 2,436 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

changing the links style/status dynamically

25 New Member
Hi,
My html has

[HTML]<Table style="year-button-archive" width="60%" >
<tr>
<td class="gold" >
<a title="year">By Year:</a>
<td class="gold">
<a id = "2008" title="2008" href="../announcementLis t.do?year=2008" >
2008
</a>&nbsp; | &nbsp;</td>
<td class="gold">
<a id = "2007" title="2007" href="../announcementLis t.do?year=2007" >2007 </a>&nbsp; | &nbsp;
</td>
<td class="gold">
<a id = "2006" title="2006" href="../announcementLis t.do?year=2006" >2006</a>&nbsp; | &nbsp;
</td>
<td class="gold">
<a id = "2005"title="20 05" href="../announcementLis t.do?year=2005" >2005 </a>&nbsp; | &nbsp;
</td >
<td class="gold">
<a id = "all" title="All" href="../announcementLis t.do?year=all"> All </a>
</td>
</tr>
</Table>
[/HTML]

my style sheet has

Expand|Select|Wrap|Line Numbers
  1. .gold {
  2.     color: #877514;
  3. }
  4.     .gold A:link {COLOR: #877514;    TEXT-DECORATION: none }
  5.     .gold A:visited {COLOR: #877514; TEXT-DECORATION: none }
  6.     .gold A:hover {COLOR:red;    TEXT-DECORATION: underline; }
  7.     .gold A:active {COLOR: #877514;    TEXT-DECORATION: none }
  8.  
  9.  
when i am doing a mouse over on the links its changing to red and underline is displaying,on clicking any link i need to change the colour of the link from to
red colour(say i clicked 2008)
once again if i click 2007 the colour of 2007 should change to red and my 2008 back to #877514 colour.

how can i do this

help me out
Thanks in advance...
Oct 9 '08 #1
4 1932
acoder
16,027 Recognized Expert Moderator MVP
This is not possible with CSS, but you can use JavaScript. If so, I can move this thread to the JavaScript forum for you.
Oct 9 '08 #2
sgxbytes
25 New Member
yes can move to javascript forum


This is not possible with CSS, but you can use JavaScript. If so, I can move this thread to the JavaScript forum for you.
Oct 9 '08 #3
sgxbytes
25 New Member
hi
My html is:


[HTML]<Table style="year-button-archive" width="60%" >
<tr>
<td class="gold" >
<a title="year">By Year:</a>
<td class="gold">
<a id = "2008" title="2008" href="../announcementLis t.do?year=2008" >
2008
</a>&nbsp; | &nbsp;</td>
<td class="gold">
<a id = "2007" title="2007" href="../announcementLis t.do?year=2007" >2007 </a>&nbsp; | &nbsp;
</td>
<td class="gold">
<a id = "2006" title="2006" href="../announcementLis t.do?year=2006" >2006</a>&nbsp; | &nbsp;
</td>
<td class="gold">
<a id = "2005"title="20 05" href="../announcementLis t.do?year=2005" >2005 </a>&nbsp; | &nbsp;
</td >
<td class="gold">
<a id = "all" title="All" href="../announcementLis t.do?year=all"> All </a>
</td>
</tr>
</Table>
[/HTML]

my css



Expand|Select|Wrap|Line Numbers
  1.    1. .gold {
  2.    2.     color: #877514;
  3.    3. }
  4.    4.     .gold A:link {COLOR: #877514;    TEXT-DECORATION: none }
  5.    5.     .gold A:visited {COLOR: #877514; TEXT-DECORATION: none }
  6.    6.     .gold A:hover {COLOR:red;    TEXT-DECORATION: underline; }
  7.    7.     .gold A:active {COLOR: #877514;    TEXT-DECORATION: none }
  8.    8.  
  9.  

when i am doing a mouse over on the links its changing to red and underline is displaying,on clicking any link i need to change the colour of the link from to
red colour(say i clicked 2008)
once again if i click 2007 the colour of 2007 should change to red and my 2008 back to #877514 colour.

how can i do this

help me out
Thanks in advance...
Oct 9 '08 #4
acoder
16,027 Recognized Expert Moderator MVP
Moved to the JavaScript forum and merged with the thread you've posted here.

Please use code tags when posting code. See How to ask a question.

Moderator.
Oct 9 '08 #5

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

Similar topics

2
3514
by: RIck Measham | last post by:
I have a dynamically generated table, filled from a database by a perl application. Each row represents a database record and has a 'status' and a unique 'id'. What I want to do is create buttons to hide all rows with a particular status. The code to show/hide is relatively easy, but how do I turn them all off at once? Several ideas I had:
2
3087
by: George Hester | last post by:
I have an applet which is a cube each face if which is a link. I have a floating <DIV> element which when the mouse is over the applet it pops up showing the text of all the links in the applet. What I would like is when the mouse is over one of the faces of the cube the corresponding text in my <DIV> will highlight. So in other words this is sort of like have a link on a page and when the mouse is held over it, some other area of the html...
4
16216
by: Kenny | last post by:
I have been trying to write a script that will increase the size of and image when you mouse over it, and decrease it to original size, when you mouse out. After a couple of attempts, this is what I've come up with. In this example, there are 5 images (0 thru 4) all with a height of 80px. When you mouse over an image, it changes the growingImage variable equal to the number of the image you mouse over, when you mouse out, it sets it to 5,...
2
2871
by: wjbell | last post by:
I have a piece of javascript I need to modify. Right now it changes a stylesheet in the document between style.css and no_indent.css. These are in the head of my document: <link rel=stylesheet href=/style.css> <link rel=stylesheet href=/no_indent.css> <link rel=stylesheet href=/style.css> What the code below does is toggle between the two depending on what
6
15900
by: Carla | last post by:
hi people, I have a little problem that I can't solve with css and i was wondering if you could help me. I have 4 links, I want that when I click/mouseover in the link 1, it turns to a color a, then when I click/mouseover over the link 2, it turns to a color b and the link 1 turns to the normal link color again. (an so with the other links). Is this possible with CSS?
2
1744
by: Dominic Myers | last post by:
Hi there, wondered if someone could point me to an appropriate tutorial or offer advice on the following problem? I've got a web page which uses lots of divs to position the content of the page and I'm using a nice javascript to alter the css of a table of links. The thing is I don't want the table of links to point to an external site but to calla function which will replace the content of a layer... perhaps it's be better if I...
5
1552
by: Andrew Poulos | last post by:
I'm trying to change a style in a stylesheet. The following code works in FF, MZ, and IE6 but IE 5 gives the error of "invalid procedure call or argument": var oStyleSheet = window.document.styleSheets.imports; oStyleSheet.addRule("td","font-size:1.2em;"); Is there a way to do this with IE 5? Andrew Poulos
26
8126
by: johkar | last post by:
I need to cancel the link and execute a function onclick of all the links within the span tag which has a class of "container" assigned. There will be only one span tag with this class applied. I know you can get a specific tag using document.getElementsByTagName('span'), but I am unsure how to get the one with the class="container". I know there is a getAttribute method, just need a pointer or two to put it all together. Once I know...
2
1124
by: ramaswamynanda | last post by:
Hello All, I am a newbie to web development, so please help me out with this issue. html --------- <form id="Form1" method="post" runat="server"> <asp:TextBox id="txtempid" style="Z-INDEX: 101; LEFT: 256px; POSITION: absolute; TOP: 160px" runat="server" Width="184px"></asp:TextBox> <asp:Label id="Label1" style="Z-INDEX: 102; LEFT: 32px; POSITION: absolute; TOP: 152px" runat="server" Width="152px" Height="32px">Enter...
0
9641
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10146
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8968
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7494
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6735
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5378
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4044
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3643
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2875
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.