Small problem. I have a div id="comHere"
somewhere in the middle of the design.
And at the top of the design, I have an <a href="#comeHere">Click Here</a>
.
Now, when I click on the href link, it scrolls to the div using this code
scrollTop: $($anchor.attr('href')).offset().top
My requirement is that, say the div
is having a position offset of 600px
from top, when I click on the link I want the scroll to happen to 600px+100px
and not to 600px
.
Is this possible using jQuery ?
Thanks, Dev
scrollTop: $($anchor.attr('href')).offset().top - 100
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With