December 12, 200817 yr Hi, I have my navbar link background image set in css and when i hover it changes to a different color image but what I want to do is keep the link background color image the same as the hover after I release the click and move the curser away from the link. The following site has the effect I mean, when you hover the links turn orange and the link stays orange after I click and move away. http://www.westciv.com/style_master/index.html Many thanks in advance, Mark mark.steen@live.co.uk
December 12, 200817 yr You need a variable on each page called something like 'currentPage', which changes the style of the 'active' link to your specification... SO <a href='#' <if currentPage = 'contactUs' then> style='background: #123456;</endif> >CONTACT BUTTON</a> <a href='#' <if currentPage = 'aboutUs' then> style='background: #123456;</endif> >ABOUT BUTTON</a> Does that make sense ??
December 12, 200817 yr or hard code ie: <ul> <li><span>page 1</span></li> <li><a href="page2.html" title="">page 2</a></li> </ul> <ul> <li><a href="page1.html" title="">page 1</a></li> <li><span>page 2</span></li> </ul> or 1st post developed a bit... <?php while($links[$i]) { if($i==$curpage) {$extracode=' class="current" '; } else {$extracode=''; } echo '<a href="..." title="" '.$extracode.'>...</a>'; } ?>
December 15, 200817 yr Author Hi Satin, Many thanks! I had to amend your code slightly by taking off the > after 'then' one of the > after the 'endif' to get it to work but many thanks as I'd not have been able to get that far! Cheers pal.
December 15, 200817 yr Author Hi Mikejonsey, I've only tried Satin's code so far and got it working but I will try your code in the future. Many thanks! Mark
December 16, 200817 yr Hi Satin, Many thanks! I had to amend your code slightly by taking off the > after 'then' one of the > after the 'endif' to get it to work but many thanks as I'd not have been able to get that far! Cheers pal. I wrote it in a generic code - not php, asp or anything - just to give you an idea ! By choice, I'd have written it in Coldfusion, but not many other people use that !
Create an account or sign in to comment