Is there a delay between the value in js and the value in the page when Mini Program bindscroll saves the value?

problem description

get the current height through the scroll event of bindscroll, and then compare it with the values in the array to set the current category on the left

the environmental background of the problems and what methods you have tried

clipboard.png

js

clipboard.png

related codes

/ / Please paste the code text below (do not replace the code with pictures)
scroll: function (t) {

var that =this;
var a = this.data.dataheith, e = this.data.catalogSelect;

  for (var o = t.detail.scrollTop, s = 0; s < a.length; sPP){
      if (o <= a[s]) {
        if(e !=a[s]){
          this.setData({
            scroll_top: o,
            catalogSelect: s,
            toType: "type" + (s - 2)
          });
          break;
        }

      }
  }
console.log(that.data.catalogSelect)
},

what result do you expect? What is the error message actually seen?

Why does the value stutter, which has been successfully agreed in js? how does the delay in html come out?


has been solved, and it is my own judgment that leads to a lot of setdata


I don't have a lot of setData. Why is this also the case

?
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-1e6866f-4d3ac.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-1e6866f-4d3ac.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?