SoFunction
Updated on 2025-04-13

Recommend JS to implement product classification to search bar friendly prompts (human-computer interaction)



[Ctrl+A Select all Note:Introducing external Js requires refreshing the page before execution]

principle:
pixelTop and offsetTop are different, pixelTop is actually a digital form. And offsetTop is the actual offset of the object.

At the beginning, the top of this fk object is undefined and undefined, so pixelTop is 0, and offsetTop is actually the margin value because of the existence of the margin of the body instead of 0.

If you have read the menu code of the pj that I modified, you will also see a similar hack for the original pixelTop:
/