1
votes

I am using the jQuery .scrollTop function on a page I'm building which is working fine in general, though I have a contact div that opens from the top of the page that changes the defined top of the page which changes the offset of each scroll once it's opened. Is there a way to define the top of the page as the top of a specific div rather than the actual page.

I hope this makes sense. Thank you.

1

1 Answers

0
votes
$(window).scrollTop($('#yourDiv').offset().top);