[Q] Can i add offset when using dynamic target tag?
Closed this issue · 1 comments
I found this script but sadly cant remember where i got it from. WIth it can use tags going from one page to a other using ID's
$(document).ready(function () { // Call $.smoothScroll if location.hash starts with "#smoothScroll" var reSmooth = /^#smoothScroll/; var id; if (reSmooth.test(location.hash)) { // Strip the "#smoothScroll" part off (and put "#" back on the beginning) id = '#' + location.hash.replace(reSmooth, ''); $.smoothScroll({ scrollTarget: id, }); } });
Im wondering how i can add offset to it?
Im mistaken, im not sure how i got the code but it seems from this plugin https://github.com/kswedberg/jquery-smooth-scroll
Though i like the smooth scrolling this one ads. So i added them both
The target function from the other one is quite nice