https://github.com/rafbm/heading-anchors
Heading Anchors automatically creates and handles “¶” anchors on a web page.
https://github.com/rafbm/heading-anchors
Last synced: 3 months ago
JSON representation
Heading Anchors automatically creates and handles “¶” anchors on a web page.
- Host: GitHub
- URL: https://github.com/rafbm/heading-anchors
- Owner: rafbm
- License: mit
- Created: 2010-10-06T04:05:51.000Z (almost 16 years ago)
- Default Branch: master
- Last Pushed: 2012-02-09T04:52:55.000Z (over 14 years ago)
- Last Synced: 2025-02-26T05:47:27.396Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 111 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Heading Anchors
===============
Heading Anchors automatically creates and handles “¶” anchors on a web page. As seen on [Google Code](http://code.google.com/p/zen-coding/), [Trac](http://trac.cyberduck.ch/), 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.