I have a <div id="innerContent">
with overflow-y:scroll;
.
Links to anchors within innerContent are located on parent page, not in the div
.
So far, I have tried anchors and scrollto's to attempt to scroll within the content.
They both complete the scroll, but innerContent's height is larger than the browser window, so the entire parent page also scrolls to the anchor when the links are clicked.
Is there a way to do this with javascript, without moving the parent page?
I do not have control over the height of the div - this is someone else's design.
This came close... but there isn't an answer here.
How to automatic scroll inline div without scrolling the whole page?
Thank you!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…