Skip to content

Instantly share code, notes, and snippets.

Guy Pensart pensart

Block or report user

Report or block pensart

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@pensart
pensart / Smooth scroll on hash targets
Last active Feb 24, 2017
Smooth scroll on # targets and show no hash in the url
View Smooth scroll on hash targets
// Warning, this wil target all # elements
// Even when they do not link to a location on the page
// For example, #next-arrow will also prevent the default behavior
$('a[href^="#"]').on('click', function (e) {
e.preventDefault();
var target = this.hash;
var $target = $(target);
You can’t perform that action at this time.