How does WeChat Mini Programs judge that the element is in the visual area?

apart from the scroll-view component, what other way does WeChat Mini Programs have to know if the element is in the visual area?-sharp-sharp-sharp

Apr.08,2022

Mini Program is relatively simple:
the distance of the dom.top element from the top of the window notes that it changes as you scroll.
the height of the dom.height element.
height of the windowHeight window.

if the top of the element is within the window height range, it is proved to be in the visible area.
if (el.top < windowHeight & & top > 0) {can be judged}

be more rigorous and add the height of the element itself.

if (el.top < windowHeight & & el.top+el.height > 0) {

 

}

variables are obtained in two ways:

//
 var SystemInfo = wx.getSystemInfoSync()
  console.log(SystemInfo.windowHeight)
 // 
    var query = wx.createSelectorQuery();
    //id
    var that = this;
    query.select('-sharpyuyue').boundingClientRect(function (rect) {
       console.log(':'+rect.top)
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-1c2f0d9-33c57.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-1c2f0d9-33c57.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?