javascript history breadcrumbs - UniversityEssaydatesCom

javascript history breadcrumbs

By | 15.08.2018
Skip to content

Please note that GitHub no longer supports Internet Explorer.

We recommend upgrading to the latest Microsoft Edge , Google Chrome , or Firefox .

Learn more

Sign in
or
Sign up


  • Watch

    3


  • Star

    10


  • Fork

    6


/ hanselsrevenge

Join GitHub today

GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.

Sign up


JQuery historical based breadcrumbs



  • 68

    commits



  • 1

    branch



  • 5

    releases



  • Fetching contributors


  1. JavaScript
    72.1%


  2. CSS
    27.9%

JavaScript
CSS


Switch branches/tags
  • Branches
  • Tags



master

Nothing to show



2.0.2



2.0.1



2.0.0



1.0.2



1.0.1

Nothing to show

Find file

Clone or download

Clone with HTTPS

Use Git or checkout with SVN using the web URL.



Open in Desktop

Download ZIP

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching Xcode

If nothing happens, download Xcode and try again.

Launching Visual Studio

If nothing happens, download the GitHub extension for Visual Studio and try again.

Cannot retrieve the latest commit at this time.
Cannot retrieve the latest commit at this time.


Permalink

Failed to load latest commit information.

bower_components

images

.gitignore

README.md

bower.json

default.htm

documentation.htm

hanselsrevenge.css

historical_breadcrumbs.htm

jquery.hanselsrevenge.js

story.htm


README.md

Hansels Revenge (jquery.hanselsrevenge)

Hansel is a breadcrumb helper which operates in the true fashion of how the fairy tale intended and gives the user a history which does not require them to use their backbutton.

See a demo of how it works. http://whiteboard-it.com/hanselsrevenge/default.htm

Installation

Hansel’s Revenge is now on bower

bower install hanselsrevenge

Preferably, you would have a gulp package setup to minify and combine your javascript into a package. However if you don’t you can add the references manually.

Include the following script references

<script src="bower_components/jquery/dist/jquery.js" type="text/javascript"></script>
<script src="bower_components/bootstrap/dist/js/bootstrap.js"></script>
<script src="bower_components/jquery.cookie/jquery.cookie.js" type="text/javascript"></script>
<!--[if lt IE 9]>
<script type="text/javascript" src="bower_components/json2/json2.js"></script>
<![endif]-->
<script src="jquery.hanselsrevenge.js" type="text/javascript"></script>

Have a Breadcrumb structure which resembles the following on the page.
If inheritBreadCrumbs is set to true then this will default the breadCrumb trail to this path.

<ul ><li><a href="/path/to/landing/crumb">Home</a></li></ul>

That’s it in order to get the default functionality.

If you would like to explore some of the other options available to hansels then have a look at the bottom of jquery.hanselsrevenge.js

var breadCrumbSelector = ".breadcrumbs";
$(breadCrumbSelector).ready(function() $.fn.hanselsRevenge(breadCrumbSelector:breadCrumbSelector, maxDepth: 5, debug:false, cookieOptions:path:"/")
)

You can change the options available there or remove that section and make the call to hanselsRevenge on your page with whatever options you like.

  • maxDepth is the maximum displayed depth that a cookie path can go
  • inheritLandingCrumbs when true accepts the starting path implied by the unordered list that is on the page at load time. When false if the current page is the landing page then it will begin the path there.
  • defaultTrail is an array with the default trail. only applies if inherit is false
  • cookieOptions will accept any option that the $.cookie project can accept in their $.cookie options parameter. For more information on this have a look at this project. https://github.com/carhartl/jquery-cookie/

Support

  • Tested and working in all modern browsers and IE 6+
  • if you don’t care about supportting ie < 8 you can remove the json2 ref

Special Thanks To

  • json2 by Douglas Crockford https://github.com/douglascrockford/JSON-js/
  • jquery.cookie by Klaus Hartl https://github.com/carhartl/jquery-cookie

MIT License

http://www.opensource.org/licenses/mit-license.php

Author

Martin Murphy
http://whiteboard-it.com



You can’t perform that action at this time.

You signed in with another tab or window. Reload to refresh your session.
You signed out in another tab or window. Reload to refresh your session.

Press h to open a hovercard with more details.
Iconic One Theme | Powered by Wordpress