jquery-stickytabs
jquery-stickytabs copied to clipboard
Translate code to ES6, add support for named routes instead of selector
In this pull request, I've added:
- Refactor ES6
- Add support for named routes
Example of usage:
Sometimes, we need different name than just element ID, so let's define object like:
let routes = {
"nav-item1" : "this-is-item1-page",
"nav-item2" : "this-is-item2-page",
"nav-item3" : "this-is-item3-page",
};
So instead of #nav-item1
we'll have #this-is-item1-page
in URL.
To enable this feature, you can just pass option named routeObject
:
$('.nav-tabs').stickyTabs({routeObject : routes});
If this option is not passed, default elements IDs will be used.