A special customer requirement: to display data in a table on a page, the data volume is not large. If you do not want to use the browser's scroll bar, you can only scroll The data in the table in the Div, however, there is a special requirement that the scroll bar must be automatically rolled to the bottom to query the relevant information. The Div does not have the auto-scroll attribute and can only simulate the scroll of the mouse to achieve the desired effect.
The key part is here: p. scrollTop = p. scrollHeight;
The following is the simplified code:
The Code is as follows:
| Id |
Name |
Age |
Memo |
| 000001 |
Name1 |
24 |
Memomemomemomemomemo |
| 000002 |
Name2 |
23 |
Memomemomemomemomemo |
| 000003 |
Name3 |
23 |
Memomemomemomemomemo |
| 000004 |
Name4 |
23 |
Memomemomemomemomemo |
| 000005 |
Name5 |
23 |
Memomemomemomemomemo |
| 000002 |
Name2 |
23 |
Memomemomemomemomemo |
| 000003 |
Name3 |
23 |
Memomemomemomemomemo |
| 000004 |
Name4 |
23 |
Memomemomemomemomemo |
| 000005 |
Name5 |
23 |
Memomemomemomemomemo |