GithubHelp home page GithubHelp logo

mre / jquery.anchorfy Goto Github PK

View Code? Open in Web Editor NEW
2.0 3.0 0.0 50 KB

Create a linked list of all headers inside a container. Supports animations and is easy to adjust.

Home Page: http://matthias-endler.de/projects/anchorfy/

License: Other

JavaScript 8.67% CSS 4.27% HTML 87.05%
anchors html jquery javascript

jquery.anchorfy's Introduction

jQuery ratingbar

Introduction

jQuery anchorfy will create a linked list of all headings (h1, h2,…) within an element. It’s easy to use, fully customizable and supports scrolling animations.

So if you have a page layout with some headings in it like this:

A heading

Some very interesting text

Another heading

Boy this text is interesting!

jQuery anchorfy then creates an unordered list from that:

  • A heading
  • Another heading

This does not look very sophisticated yet, does it? But naturally you can create a nice style with CSS. Check out the included example files.

Installation

  1. Copy the folders js and css of the downloaded package into the root directory of your website.

  2. Add jQuery and the anchorfy plugin into the header of the page:

     <head>
     ...
     <script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
     <script type="text/javascript" src="js/jquery.anchorfy.js"></script>
     <script type="text/javascript" charset="utf-8">
     $(document).ready(function() {
     $('.example').anchorfy();
     });
     </script>
     ...
     </head>
    
  3. Change the name of the selector (here: example) in the above code to match an element inside your layout.

4 Create an element with class anchor between <body> and </body> where a list with all headings:

	<div class="anchors"></div>

That’s it. Have fun!

License

Copyright Matthias Endler. Dual licensed under the MIT and GPL licenses.

The text that is used for this example is borrowed from the great book “Why’s (poignant) Guide to Ruby”. The book and excerpt used in this example are distributed under the Creative Commons Attribution-ShareAlike license. Copyright by why.

jquery.anchorfy's People

Contributors

mre avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  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.