1

I am having 100 list which can be open one at a time, and each list contains dynamic length of data.
If I click on list 1 it expands and all the list go down and when I click on close list 1 it return to it's own state and rest of the list come up.

The problem occurs when I open list1 and then scroll down to list2 and try to open it.
In this case list - 1 will auto close and list2 open but page position varies if list1 is having high height and list2 is low height.

I was trying to scroll on to clicked item by using this code

window.scrollTo(e.screenX,e.screenY);

here is a link demo what i try to achieve Link

https://jsfiddle.net/69z2wepo/280996/

but it's not working well for last element as x and y contain view port distances. if anyone know how to solve this please help, any useful suggestion is appreciated.

Rupesh Agrawal
  • 387
  • 7
  • 21
Amit Chauhan
  • 343
  • 1
  • 2
  • 13
  • Check this out. https://stackoverflow.com/questions/6677035/jquery-scroll-to-element – nkt217 Aug 30 '18 at 07:04
  • You'll need to provide your code in order for people to help you. Simply describing the problem without providing the root of the problem makes it unsolvable... – Martin Aug 30 '18 at 07:06

0 Answers0