jQuery Plugin To Generate Breadcrumbs From A Sitemap

File Size: 43.3 KB
Views Total: 8396
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
jQuery Plugin To Generate Breadcrumbs From A Sitemap

A jQuery based breadcrumbs generator used to create an user-friendly breadcrumb navigation from a nested list based sitemap.

How to use it:

1. Create a sitemap that lists the web pages of your website.

<nav id="sitemaps">
    <li> <a href="index.html">Home</a>
        <li> <a href="sample/menu1.html">Menu1</a>
            <li><a href="sample/menu1-1.html">Menu1-1</a></li>
            <li><a href="sample/menu1-2.html">Menu1-2</a></li>
        <li><a href="sample/menu2.html">Menu2</a></li>
        <li> <a href="sample/menu3.html">Menu3</a>
            <li><a href="sample/menu3-1.html">Menu3-1</a></li>
            <li> <a href="sample/menu3-2.html">Menu3-2</a>
                <li><a href="sample/menu3-2-1.html">Menu3-2-1</a></li>
                <li><a href="sample/menu3-2-2.html">Menu3-2-2</a></li>
                <li><a href="sample/menu3-2-3.html">Menu3-2-3</a></li>

2. Create an empty list for the breadcrumbs.

<ol id="breadcrumbs"></ol>

3. Load jQuery library and the jQuery Breadcrumbs Generator on your webpages.

<script src="//code.jquery.com/jquery.min.js"></script>
<script src="jquery.breadcrumbs-generator.js"></script>

4. Call the plugin to automatically generate a breadcrumb navigation into the list container you just created.


5. Available options.

  sitemaps  : '#sitemaps',
  index_type: 'index.html'

6. Tweak the CSS styles to create your own styled breadcrumbs.

#breadcrumbs li { display: inline-block; }

#breadcrumbs li:not(:first-child) { margin-left: 0.4em; }

#breadcrumbs li:not(:first-child):before {
  content: ">";
  margin-right: 0.4em;



  • v1.0.2: Fixed a reference to undefined variable `sitemaps`

This awesome jQuery plugin is developed by sutara79. For more Advanced Usages, please check the demo page or visit the official website.