admin管理员组

文章数量:1611397

解决兼容性的方案 https://github/wilddeer/stickyfill

// 对于支持sticky的浏览器直接使用CSS吸顶效果,否则使用Stickyfill模拟吸顶解决兼容问题
  if ( !('CSS' in window && CSS.supports && CSS.supports('position', 'sticky')) ) {
    Stickyfill.add( document.querySelectorAll('.stickey') );
  }
.stickey{
  position: -webkit-sticky;/* Safari */  
  position: sticky;
  top: 0;
  z-index: 2;
}

本文标签: 兼容性功能cssPositionSticky