📜  如何在滚动时隐藏下拉菜单 - 无论代码示例

📅  最后修改于: 2022-03-11 14:56:44.556000             🧑  作者: Mango

代码示例1
window.onsrcoll = function(){
     var position = 0;
     var scPos = (this.pageYOffset || document.documentElement.scrollTop) - (document.documentElement.clientTop || 0);
     position += scPos;
     if(position > scPos) {
      // code here to hide drop-down menu.
     }
    }