Jump to content

highlight link if on that page?


forcer

Recommended Posts

I have a website design that has a tab effect on top.

 

e.g.. if i am on the home page the tab HOME is highlighted and the rest are backdropped... but if i go to contact page, CONTACT gets highlighted and the rest are backdropped...

 

the code i am currently using to display image links from my CMS is...

 

echo '<a href="'.$categorylink[$i].'"><img src="skins/audioloop/images/cat/' . $categoryname[$i] . '.gif" /></a>';

 

i'm guessing i need something along these lines..

 


if $categoryname[$i] == $categoryname[$i] {
echo ''<a href="'.$categorylink[$i].'"><img src="skins/audioloop/images/cat/' . $categoryname[$i] . '_focused.gif" /></a>';
} else {
echo '<a href="'.$categorylink[$i].'"><img src="skins/audioloop/images/cat/' . $categoryname[$i] . '.gif" /></a>';
}

 

i'm quite new to PHP... any ideas? Thanks

Link to comment
https://forums.phpfreaks.com/topic/112771-highlight-link-if-on-that-page/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.