Skip to content

Commit

Permalink
Merge pull request #272 from JPIglesias-Triangle/patch-1
Browse files Browse the repository at this point in the history
Added Smooth Scrolling
  • Loading branch information
juanpflores committed Sep 28, 2017
2 parents 02dd8b7 + 3f2b97d commit 2dceadf
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions assets/js/app.js
Expand Up @@ -115,3 +115,19 @@ $(function obtenerEntidad(){
});
});
});

// Smooth-Scroll
$(function() {
$('a[href*="#"]:not([href="#"])').click(function() {
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
if (target.length) {
$('html, body').animate({
scrollTop: target.offset().top
}, 1000);
return false;
}
}
});
});

0 comments on commit 2dceadf

Please sign in to comment.