mirror of
https://github.com/treffynnon/sqlstyle.guide.git
synced 2025-03-09 12:49:51 -05:00
33 lines
No EOL
667 B
JavaScript
33 lines
No EOL
667 B
JavaScript
---
|
|
layout: nil
|
|
---
|
|
|
|
{% include highlight.pack.js %}
|
|
hljs.initHighlightingOnLoad();
|
|
|
|
{% include anchor.min.js %}
|
|
anchors.add('h2,h3,h4,h5,h6');
|
|
|
|
/*
|
|
* ScrollTo code
|
|
*/
|
|
$(document).ready(function(){
|
|
$('a[href^="#"]').on('click',function (e) {
|
|
e.preventDefault();
|
|
|
|
var target = this.hash;
|
|
var dest = 0;
|
|
if(target) {
|
|
var $target = $(target);
|
|
if($target.length) {
|
|
dest = $target.offset().top;
|
|
}
|
|
}
|
|
|
|
$('html, body').stop().animate({
|
|
'scrollTop': dest
|
|
}, 900, 'swing', function () {
|
|
window.location.hash = target;
|
|
});
|
|
});
|
|
}); |