Home > HTML

Highlighting Hard Coded Active Links with jQuery

When using Drupal's menu system for linking pages on your site the corresponding menu link gets the CSS class active when the referred page is being displayed. To make use of this to improve a site's usability you can highlight this link by assigning a different color, background color, etc. Drupal's l() function also takes care to add the active class to currently displayed links.

On this site I have to blocks in the sidebar (Recommended Articles, Drupal Modules) with hard-coded links to internal pages using plain HTML. My main reason not to use menu items is because I am too lazy and I don't use the l() function to not increase the number of database queries more than necessary.

Google Hacked by Firebug

Google Hacked by Firebug

Or my very own personalized Google homepage. Firefox is a great Web browser not only because it is capable of interpreting CSS and HTML correctly but also because there are many cool extensions. A truely amazing extension for Web developers is Firebug which lets you edit, debug, and monitor CSS, HTML, and JavaScript live in any web page.

Syndicate content