Fix smooth scroll URL (#73)
This commit is contained in:
parent
61a9d7aea0
commit
18a19d02d1
1 changed files with 3 additions and 3 deletions
|
@ -24,7 +24,7 @@ var isMobile = false, isTablet = false, isLaptop = false;
|
||||||
// ================= Smooth Scroll ===================
|
// ================= Smooth Scroll ===================
|
||||||
function addSmoothScroll() {
|
function addSmoothScroll() {
|
||||||
// Add smooth scrolling to all links
|
// Add smooth scrolling to all links
|
||||||
$("a").on('click', function (event) {
|
$('a[href*="#"]').on('click', function (event) {
|
||||||
|
|
||||||
// Make sure this.hash has a value before overriding default behavior
|
// Make sure this.hash has a value before overriding default behavior
|
||||||
if (this.hash !== "") {
|
if (this.hash !== "") {
|
||||||
|
@ -47,9 +47,9 @@ var isMobile = false, isTablet = false, isLaptop = false;
|
||||||
}, 800, function () {
|
}, 800, function () {
|
||||||
|
|
||||||
// Add hash (#) to URL when done scrolling (default click behavior)
|
// Add hash (#) to URL when done scrolling (default click behavior)
|
||||||
window.location.hash = hash - offset;
|
window.location.hash = hash
|
||||||
});
|
});
|
||||||
} // End if
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
addSmoothScroll();
|
addSmoothScroll();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue