A;active staying Active
Posted: 09 April 2008 04:29 AM   [ Ignore ]
Newbie
Rank
Total Posts:  6
Joined  2008-03-20

I’m using the a:active selector to show an image when a user clicks a link.  When the new page is loaded I want my active image to still show.  Anyone know the way to once the user clicks on the page the link keeps the same “active” image behind it?

#navbar .moduletable_menu1{
    
height:35px;
    
        
}
#navbar .moduletable_menu1 ul{
    
margin:0;
    
padding:0;
    list-
style-type:none;
}
#navbar .moduletable_menu1 ul li{
    
display:inline;
}
#navbar .moduletable_menu1 ul li a{
    
text-decoration:none;
        
font-family"trebuchet MS",sans-serif;
        
font-size1em;
    
float:left;
    
height:35;
    
margin:12px 0;
    
padding:15px;
    
width:75px;
    
text-align:center;
}

#navbar .moduletable_menu1 ul li a:link {
    
color:#fff;
}

#navbar .moduletable_menu1 ul li a:visited {
    
color:#fff;
    /* background-image:url('../images/hover.gif');
    background-repeat:repeat-x;
    background-position:center;
    border: 1px solid #f16b12; */
}

#navbar .moduletable_menu1 ul li a:hover{
    
color:#000;
}

#navbar .moduletable_menu1 ul li a:active{
    
color:#000;
    
background-image:url('../images/hover.gif');
    
background-repeat:repeat-x;
    
background-position:center;
}

#navbar .moduletable_menu1 ul li a:focus{
    
color:#000;
    
background-image:url('../images/hover.gif');
    
background-repeat:repeat-x;
    
background-position:center;

Thanks!!!!

Profile
 
 
Posted: 09 April 2008 06:50 PM   [ Ignore ]   [ # 1 ]
Member
Avatar
RankRankRank
Total Posts:  52
Joined  2007-11-08

For having the ‘active’ state, you should create a class, for e.g, #navbar .moduletable_menu1 ul li a.active_menu which would contain the styles you put for the active state, and assign the class to the link you wish to be active on the page. You can either do it in the static way, assigning the class to the link you wish on every page, or do it using a javascript code that would assign the class ‘active_menu’ to the clicked link.

Profile
 
 
Posted: 21 April 2008 05:12 PM   [ Ignore ]   [ # 2 ]
Newbie
Rank
Total Posts:  6
Joined  2008-03-20

Ah, I see…

Thanks! That really helped out!!!!

Profile