Slide to the top of js to load history messages?

the scroll event used now, when sliding up, inserts elements with prepend, and it will go to the top, and this event will also be triggered when sliding downwards. How to make sure that the event will not be triggered when sliding?!

Mar.02,2021

needs to record the position of the last time, and judge whether to dash up or down according to the difference


just judge whether to go up or down,

compare the initial scrollTop, with the scrollTop after sliding


this can be written entirely on your own, without any plug-ins. In fact, it is to record the position when sliding, determine whether to slide up or down, and then deal with


has been solved. When prepend inserts an element, record the height before the parent element is inserted, and then record the height after insertion minus the height before insertion, and the scollTop setting value is subtracted.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b37b90-2c0ad.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b37b90-2c0ad.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?