- This is not compiled
- You can change everything about the code, just read through once
- Two versions available Pure JS and JQuery
- Copy all from either
main.js
orjquery.js
to your project - Add a breadcrumb container
<nav class="breadcrumb"></nav>
will do - Set the name for your homepage/landing page
- Set the history length
- Use back button if you want
Download the repo.
- Use this as container if you want back button
<nav class="breadcrumb"> <a href="#." class="breadcrumb-item btn-go-back">Back</a> <nav>
- Its added by default in JS, you can remove it if you want
- Uses
window.history
- If you don't want crumbs in home page remove the container
- Also modify this part in line 29 in
main.js
or 24 injquery.js
if (!pageName || pageName === indexPageName) { initHomeCrumb(); return; }
Let me know if you have any suggestions. Have a good one! :)
Source - https://github.com/akibrezakhan