Viewing Link Color for Current Page
Link Color for Current Page
|
User: Les C. 10 years ago
|
|
|
It would be great to have this option in the Inspector in Hyperlinks Formatting (in the Hyperlinks tab). L C |
|
|
User: Roddy 10 years ago
|
|
|
A "current" page indicator is an unnecessary complication and shouldn't be required on a web page which follows the rules of HTML layout hierarchy. Web pages are laid out with an <h1> heading for the site name and then an <h2> heading, immediately below the header, which contains the page name. This page name should contain the main keywords for the page and be related to the keywords in the navigation. On larger sites with directories, the normal pratice is to use breadcrumbs which are a far better way to of letting the vistor know exactly where they are in site. Breadcrumbs are usually placed at the top of the page but it's a good idea to duplicate them at the bottom of any page which requires scrolling to see all the content. ------------------------------- Roddy Website: http://everwebwidgets.com Contact: http://everwebwidgets.com/ewWidgets-home/contact.html NOTE: I am an EverWeb user and NOT affiliated with EverWeb! Any opinions expressed in this forum are my own. |
|
|
User: Jumbo T. 10 years ago
|
|
|
Paste the script in the Footer Code Box of the Page or Site <script> theMenu = document.getElementById('navmenu_menu0'); tar = theMenu.getElementsByTagName('a'); $target = window.location.href; if ( $target.lastIndexOf('/') < 0 ){ $target += 'index.html'; } for (var i = 0 ; i < tar.length ; i++ ) { if ( tar[i].href.indexOf($target) >= 0 ){ tar[i].style.backgroundColor = "green"; tar[i].style.color = "yellow"; } } </script> Here you can find the style properties : http://www.w3schools.com/jsref/dom_obj_style.asp |
|
|
User: Jumbo T. 10 years ago
|
|
|
The if statement did not work properly. Here's the new code : <script> theMenu = document.getElementById('navmenu_menu0'); tar = theMenu.getElementsByTagName('a'); $target = window.location.href; if ( $target.charAt($target.length-1) == '/' ){ $target += 'index.html'; } for (var i = 0 ; i < tar.length ; i++ ) { if ( tar[i].href.indexOf($target) >= 0 ){ tar[i].style.backgroundColor = "green"; tar[i].style.color = "yellow"; } } </script> Last edit 10 years ago |
|
|
✔ Best Answer
|
|
|
User: Les C. 10 years ago
|
|
|
Last edit 10 years ago |
|
|
User: Les C. 10 years ago
|
|
|
--Jumbo Just what I needed—a simple and elegant visual clue. Thanks, L C Last edit 10 years ago |
|
| Post Reply |
| You must login or signup to post. |
