Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript
|
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 9th, 2008, 04:50 AM
Authorized User
 
Join Date: Sep 2008
Posts: 87
Thanks: 1
Thanked 0 Times in 0 Posts
Default dynamic change of style

hi
My html is:


<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="../announcementList.do?year=2008">
                        2008
                        </a>&nbsp; | &nbsp;</td>
                    <td class="gold">
                        <a id = "2007" title="2007" href="../announcementList.do?year=2007">2007 </a>&nbsp; | &nbsp;
                    </td>
                    <td class="gold">
                        <a id = "2006" title="2006" href="../announcementList.do?year=2006">2006</a>&nbsp; | &nbsp;
                    </td>
                    <td class="gold">
                        <a id = "2005"title="2005" href="../announcementList.do?year=2005">2005 </a>&nbsp; | &nbsp;
                    </td >
                    <td class="gold">
                        <a id = "all" title="All" href="../announcementList.do?year=all">All </a>
                    </td>
                    </tr>
            </Table>


my css



   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.



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...


 
Old October 9th, 2008, 04:53 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

You may want to take a look here for some inspiration: http://imar.spaanjaars.com/QuickDocId.aspx?quickdoc=299

Cheers,

Imar


---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of Beginning ASP.NET 3.5 : in C# and VB, ASP.NET 2.0 Instant Results and Dreamweaver MX 2004
Want to be my colleague? Then check out this post.
 
Old October 9th, 2008, 10:29 PM
Authorized User
 
Join Date: Sep 2008
Posts: 87
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Hi,

i have used this way

function showYear(){
    alert(<%= request.getParameter("year") %>);
    var sYear = <%= request.getParameter("year") %>;
    alert("sYear" +sYear);
    if(sYear != null){
    alert(sYear);
    document.getElementById(sYear).style.color = "red";
    }
}

from request i am able to get 2008,7,6,5 at alert(<%= request.getParameter("year") %>); but when i click on all
my alert(<%= request.getParameter("year") %>); is taking full url instead of all alone.

how can i go ahead with this...


 
Old October 10th, 2008, 04:45 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Heuh? I have no idea what you're saying. Can you please

a) describe the problem in more detail and
b) post the HTML source as it appears in the browser, not the server side (ASP?) code.

Imar


---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of Beginning ASP.NET 3.5 : in C# and VB, ASP.NET 2.0 Instant Results and Dreamweaver MX 2004
Want to be my colleague? Then check out this post.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Change C# application Visual Style niting85 .NET Framework 2.0 0 April 30th, 2007 03:27 AM
change style.backgroundColor the reset all others crmpicco Javascript How-To 2 September 29th, 2005 09:52 AM
Change style attribute of a WebUserControl YiannisF ASP.NET 1.0 and 1.1 Basics 1 July 10th, 2004 02:19 PM
!resolved! - a change in coding style grimmy PHP How-To 1 June 27th, 2004 10:21 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.