//앵커 이동시 부드럽게
$('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;
}
}
});
'WEB > jQuery' 카테고리의 다른 글
폴리필(polyfill) (0) | 2017.02.13 |
---|---|
Filter 와 Sort 기능을 갖춘 반응형 레이아웃 js 플러그인 – isotope.js (0) | 2017.02.03 |
모든js CDN 사이트 (0) | 2017.01.10 |
prefixfree.js (0) | 2017.01.05 |
jQuery CDN 이용하기 (0) | 2016.12.14 |