GithubHelp home page GithubHelp logo

zenweasel / anchorify.js Goto Github PK

View Code? Open in Web Editor NEW

This project forked from willdurand/anchorify.js

0.0 2.0 0.0 131 KB

A dead simple jQuery plugin for automatically creating anchored headings in your HTML documents.

Home Page: http://plugins.jquery.com/anchorify/

License: MIT License

anchorify.js's Introduction

Anchorify.js

Build Status

Anchorify.js is a dead simple jQuery plugin for automatically creating anchored headings in your HTML documents. It guarantees uniqueness of the anchor names, and is able to reuse existing ids.

Usage

It could not be easier:

$('h2 h3').anchorify();

Anchorify.js generates clean anchor names:

<h2>Hello, World!</h2>
<!-- would become: -->

<h2 id="hello-world">Hello, World!<a href="#hello-world" class="anchor-link"></a></h2>

By default, it uses the sign for the links' text, and adds an anchor-link CSS class on each link.

However, you can configure your own text, CSS class and anchor position using the text, cssClass and position options:

$('h2').anchorify({ text: 'Hey', cssClass: 'anchor', position: 'prepend' });
<h2 id="hello-world"><a href="#hello-world" class="anchor">Hey</a>Hello, World!</h2>

License

Anchorify.js is released under the MIT License. See the bundled LICENSE file for details.

anchorify.js's People

Contributors

willdurand avatar guillaumepotier avatar

Watchers

Brent Hoover avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.