1
0
Fork 0
mirror of https://github.com/treffynnon/sqlstyle.guide.git synced 2025-03-09 12:49:51 -05:00
sqlstyle.guide/scripts.js

33 lines
667 B
JavaScript
Raw Normal View History

---
layout: nil
---
{% include highlight.pack.js %}
hljs.initHighlightingOnLoad();
2015-07-06 07:06:16 -05:00
{% include anchor.min.js %}
2015-07-06 10:53:43 -05:00
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;
}
2015-07-06 10:53:43 -05:00
}
$('html, body').stop().animate({
'scrollTop': dest
}, 900, 'swing', function () {
window.location.hash = target;
});
});
});