A simple runtime menu to navigate through page anchors
bower install smartMenu --save
"jquery": ">= 2.2.0"
<div>
<h1 data-smart-menu data-hash="title-1" data-title="Title 1">Title 1</h1>
<p>.....</p>
<h1 data-smart-menu data-hash="title-2" data-title="Title 2">Title 2</h1>
<p>.....</p>
....
</div>
$(function(){
$('[data-smart-menu]').smartMenu();
});
Option | default | |
---|---|---|
prependTo | $('body') | jquery selector: Element to prepend smartMenu |
scrollSpeed | 800 | Page scroll speed |
offset | 80 | Scroll offset |
onScrollStart | function(){} | Callback on scroll start |
onScrollEnd | function(){} | Callback on scroll end |