Skip to content

Instantly share code, notes, and snippets.

@three-inc
Created July 3, 2018 01:49
Embed
What would you like to do?
スムーススクロール(除外するものをnotに)
$(function(){
$('a[href^="#"]').not('#tabs a').click(function(){
var speed = 500;
var href= $(this).attr("href");
var target = $(href == "#" || href == "" ? 'html' : href);
var position = target.offset().top;
$("html, body").animate({scrollTop:position}, speed, "swing");
return false;
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment