Hello using Jquery
how can i scroll an element (with overflow
) to children element ?
<span id="gran">
<span id="parent">
<div class="a">
Casa
</div>
<div class="a">
Casa
</div>
<div class="a">
Casa
</div>
<div class="a">
Casa
</div>
<div class="a">
Casa
</div>
</span>
</span>
#gran {
overflow: auto;
}
I want to scroll #gran to third element with class a
so i tried this but doesn't work:
$("#gran").scrollTo('#parent > div:nth-child(3)');
I hope in your help :)
Thanks a lot and sorry for my english
question from:
https://stackoverflow.com/questions/65647905/how-to-scroll-to-nth-child-using-jquery 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…