mirror of
https://github.com/sascha-hemi/pycom-documentation.git
synced 2026-03-21 20:06:21 +01:00
1. Changed active colour of the links and buttons. 2. Fixed the issue with scrolling to the anchor point. 3. Changed content of the Pybytes iOS page
24 lines
541 B
JavaScript
24 lines
541 B
JavaScript
/*
|
|
* Smooth scroll to anchor link
|
|
*/
|
|
|
|
|
|
$(document).ready(function(){
|
|
$( 'a[href^="#"]' ).on( 'click', function( e ) {
|
|
|
|
if ( this.hash !== '' ) {
|
|
e.preventDefault();
|
|
|
|
var hash = this.hash;
|
|
var nav = $( '.navbar' ).outerHeight();
|
|
var targetOffset = $( hash ).offset().top - nav;
|
|
|
|
$( 'html, body' ).animate( {
|
|
scrollTop: targetOffset
|
|
}, 1100, function() {
|
|
//window.location.hash = hash;
|
|
} );
|
|
}
|
|
} );
|
|
} );
|