Fragment highlighting

Sunday 20 June 2004

Another JavaScript goodie for this site: Now if you follow a URL with a fragment (that is, a hash-mark indicating a particular entry on the page), the entry is highlighted when you get there. This makes it easier to find particular blog entries, since I don’t typically have a page per entry. For example, the yearly archive pages are full of fragment links. David Dorward’s Fragment Highlight script was a good crib sheet, and is more sophisticated than mine. If you want to do something like this, his script is a good place to start.

Comments

[gravatar]
Ryan Nielsen 1:02 PM on 23 Jun 2004

The highlight rendering in Safari's a little off. If you wish, I can send you a picture. I used to have a bookmark of a site that would render a page on safari and then post a window capture on the web which would make debugging a little easier, but I seem to have lost the link. Looks great on mozilla-based browsers, though!

Add a comment:

Ignore this:
Leave this empty:
Name is required. Either email or web are required. Email won't be displayed and I won't spam you. Your web site won't be indexed by search engines.
Don't put anything here:
Leave this empty:
URLs auto-link and some tags are allowed: <a><b><i><p><br><pre>.