pandean Posted June 16, 2006 Share Posted June 16, 2006 Hi, GuysI am a newbie of dynamic website. I have seen a menu effects was very cool and useful. but dont know how to create this. The immediate help will be appreciated.My problem is:When a user clicks a link on a menu, the link itself will be bold and remains the same effect on the next page.The same effect can be found at www.w3schools.comI really like this effect, but I dont know which script language I should use to achieve it. Do I have to use PHP or ASP to do it ? or just HTML and CSS?Thanks in advance.P Link to comment Share on other sites More sharing options...
SFB Posted June 16, 2006 Share Posted June 16, 2006 this can be done with php. just use php to check what page you are on and if that matches the link then make it bold <?php$location = $_SERVER['PHP_SELF'];if($location == '/index.php'){ echo ("<b>Home</b>");}else{echo ("<a href='/index.php'>Home</a><br />");}?> Link to comment Share on other sites More sharing options...
pandean Posted June 16, 2006 Author Share Posted June 16, 2006 this can be done with php. just use php to check what page you are on and if that matches the link then make it bold<?php$location = $_SERVER['PHP_SELF'];if($location == '/index.php'){ echo ("<b>Home</b>");}else{echo ("<a href='/index.php'>Home</a><br />");}?> <{POST_SNAPBACK}> Thanks. I think it will work. I wonder if it can be done in HTML coding? Link to comment Share on other sites More sharing options...
snowboard01 Posted June 16, 2006 Share Posted June 16, 2006 always use the same menu and around the linkthat would lead to the page ur on put <b>link</b> Link to comment Share on other sites More sharing options...
justsomeguy Posted June 16, 2006 Share Posted June 16, 2006 You can do it with HTML if you want to hard-code the menu on every page to have the proper link appear bold or another style. But if you only want your site to have one menu file, you will need to use PHP or something like that to determine where you are and highlight the appropriate link. Link to comment Share on other sites More sharing options...
virtualadz Posted June 16, 2006 Share Posted June 16, 2006 after searching for ages, i found this topic. i use css play.co.uk's drop-down menu, and in this code is there a possibility of changing the color based on the page <li><a href="<?php echo tep_href_link(FILENAME_ALL_PRODUCTS); ?>" class="hide"><?php echo ONE_OUR_PRODUCTS; ?></a><!--[if lte IE 6]><a href="<?php echo tep_href_link(FILENAME_ALL_PRODUCTS); ?>"><?php echo ONE_OUR_PRODUCTS; ?> <table><tr><td><![endif]--> <ul> <li><a href="<?php echo tep_href_link('index.php', 'cPath=21'); ?>"><?php echo ONE_DARJEELING; ?></a></li> <li><a href="<?php echo tep_href_link('index.php', 'cPath=26'); ?>"><?php echo ONE_GREEN; ?></a></li> <li><a href="<?php echo tep_href_link('index.php', 'cPath=25'); ?>"><?php echo ONE_BLACK; ?></a></li> <li><a href="<?php echo tep_href_link('index.php', 'cPath=22'); ?>"><?php echo ONE_ASSAM; ?></a></li> <li><a href="<?php echo tep_href_link('index.php', 'cPath=24'); ?>"><?php echo ONE_FLAVOURED; ?></a></li> <li><a href="<?php echo tep_href_link('index.php', 'cPath=23'); ? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now