Skip to content

Instantly share code, notes, and snippets.

@luisfelipe-dev
Created November 9, 2016 11:59
Show Gist options
  • Select an option

  • Save luisfelipe-dev/967989ffcf747ee303c768b77f7832ae to your computer and use it in GitHub Desktop.

Select an option

Save luisfelipe-dev/967989ffcf747ee303c768b77f7832ae to your computer and use it in GitHub Desktop.
$(document).ready(function() {
$('a[href^="#"]').on('click',function (e) {
e.preventDefault (); var target = this.hash,
$target = $(target); $('html, body').stop().animate ({
'scrollTop': $target.offset().top
}, 1000, 'swing', function () {
window.location.hash = target;
});
});
});
Quando o scroll nao vai ate a classe que voce escolheu e fica indo só nas acimas , faça o seguinte!
Coloque ' overflow: hidden ' nas classes para fazer funcionar tudo normalmente :D
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment