react javascript - how to scroll to middle of scroller x axis

Viewed 14

i have a horizontal div with lots of elements inside (with class horizontalDiv) and i want to scroll to the center of the scroll bar. no to the central element , but so the scroll bar will be exactly at the middle.

tried calculating it and tried lots of websites , but it failed once i changed the window resolution . thnx

0 Answers
Related