I have a #contact-list-scroller div that scrolls in the page. Based on a contact_XXXX ID I'd like the #contact-list-scroller scroll position to bet set to make sure the contact_XXX item is at the top of the page.
<div id="contact-list-scroller">
<div id="contact_8965">stuff</div>
<div id="contact_8966">stuff</div>
<div id="contact_8967">stuff</div>
<div id="contact_8968">stuff</div>
<div id="contact_8969">stuff</div>
.....
</div>
Here's what I have so far:
$('#contact-list-scroller').scrollTop($('#contact_' + id).scrollTop());
But that is just scrolling to the top. Ideas? Thanks
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…