Heading Anchors automatically creates and handles “¶” anchors on a web page.
JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
LICENSE
README.md
index.html

README.md

Heading Anchors

Heading Anchors automatically creates and handles “¶” anchors on a web page. As seen on Google Code, Trac, etc.

Features

  • Handles multiple identical headings nicely.
  • Has a great default selector that can be overwritten.
  • Doesn’t add any extra “¶” to the clipboard, because it uses content: '¶'.
  • Executes JavaScript at page load only, so no tiny bit of CPU is wasted when links are hovered and clicked.
  • Demonstrates no love at all for IE < 9, yet doesn’t crash them.

Usage

  1. Link to, or copy and paste the content of heading-anchors.js and heading-anchors.css anywhere in your JavaScript and CSS files.
  2. Call HeadingAnchors.init() on dom ready and pass it a selector string if the default 'h2, h3, h4' doesn’t fit your needs.