mirror of https://github.com/masayuki0812/c3.git
Quite good looking graph derived from d3.js
http://c3js.org
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
586 B
23 lines
586 B
7 years ago
|
:javascript
|
||
|
$(function(){
|
||
|
function scrollToHash() {
|
||
|
var hash = document.location.hash,
|
||
|
target = $('.column-content a[href^=' + hash + ']'),
|
||
|
position;
|
||
|
if (target.length) {
|
||
|
position = target.offset().top - 60;
|
||
|
$("html, body").animate({scrollTop:position}, 250, "swing");
|
||
|
}
|
||
|
}
|
||
|
$(window).on('hashchange', scrollToHash);
|
||
|
|
||
|
// When clicked
|
||
|
$('a[href^=#]').click(function(){
|
||
|
document.location.hash = $(this).attr("href");
|
||
|
return false;
|
||
|
});
|
||
|
|
||
|
// When loaded
|
||
|
$(window).trigger('hashchange');
|
||
|
});
|