Target Highlighting Library

The Target Highlighting Library, or THL, is a small library which automatically applies a class to the target of an intra-page link. Like AUL, it's an example of unobtrusive JavaScript. It was written to get around the problem of users not necessarily being able to find what has been linked to when they click an intra-page link; this problem is particularly apparent when the content is near the bottom of the page, because it will then no longer appear at the top of the viewport, as is usually the case.

Please read the comments in the script to see how to include it, and how to use CSS to turn the effect on and off.

Download script | test page

Original URL: