Vertical scroll detect on datatable with both horizontal and vertical scroll.
Vertical scroll detect on datatable with both horizontal and vertical scroll.
Evie
Posts: 7Questions: 2Answers: 0
My datatable has both horizontal and vertical scrolling. I would like to detect when I scroll down only but when I use the following:
$('div.dataTables_scrollBody').scroll( ... );
It also detects the scrolling horizontally. Can someone help me figure this out: I want to add a row to my datatable only when I scroll down. (not when i scroll up or scroll to the left or right.)
Thank you
This question has accepted answers - jump to:
This discussion has been closed.
Answers
Maybe one of the techniques in this SO thread will help.
Kevin
Thank you Kevin for the quick response. The thread was helpful, but didnt completely solve the issue. I can now detect vertical scroll only.
But how about if I want to detect if I am at the end of a vertical scroll?
This SO thread shows some options to determine when the end of the scroll window is reached. Combining techniques from both threads I built an example for you:
https://live.datatables.net/penuceza/1/edit
Use any of those or other standard jQuery/Javascript methods you wish to monitor the vertical scrolling of the table.
Kevin
Thank you Kevin, this was really very helpful.