当前位置: 首页 > news >正文

让fixe和absolute根据锚点元素定位

作用

让fixe和absolute根据锚点元素去定位

使用方式

父元素

 anchor-name: --health-selected;

子元素

    const supportAnchor = 'position-anchor' in document.createElement('div').style;const table = document.querySelector('.health-select-all-table') as unknown as HTMLElement;const target = document.querySelector('.health-table-select-all-checkbox');if (isTreeData || !target || !supportAnchor) return;target.parentElement.style.cssText += `border-top: 1px solid rgba(0, 0, 0, 0.1);position: fixed;position-anchor: --health-selected;bottom: anchor(bottom);left: anchor(left);right: anchor(right);background: #fff;`;table.style.paddingBottom = `${target.parentElement.getBoundingClientRect().height}px`;

在这里插入图片描述

http://www.dtcms.com/a/182969.html

相关文章:

  • python如何提取Chrome中的保存的网站登录用户名密码?
  • 2021-11-16 C++歌手去掉2最高2最低均分
  • 《从零构建大模型》PDF下载(中文版、英文版)
  • [面试]SoC验证工程师面试常见问题(六)高速接口篇
  • [CANN] 安装软件依赖
  • 如何在postman使用时间戳
  • 【Linux基础】文件查找和文本处理指令
  • Java基础 集合框架 Collection接口和抽象类AbstractCollection
  • drf 使用jwt
  • 智能库室联管联控系统|智能兵器室门禁管理系统
  • transformers基础组件之pipeline
  • navicat 如何导出数据库表 的这些信息 字段名 类型 描述
  • 《AI大模型应知应会100篇》第53篇:Hugging Face生态系统入门
  • 【动态导通电阻】软硬开关下GaN器件的动态RDSON
  • 使用FastAPI和React以及MongoDB构建全栈Web应用02 前言
  • 投影显示技术全解析:主流方案对比与雷克赛恩 CyberPro1 的核心优势
  • Jmeter中的BeanShell如何使用?
  • vscode_python远程调试_pathMappings配置说明
  • 美国、日本、印度、印度尼西亚\东帝汶、台湾电台电视地图数据
  • [学习]RTKLib详解:rtksvr.c与streamsvr.c
  • 光流 | 基于深度学习的光流估计算法汇总,原理,公式,流程图,代码
  • Android平台FFmpeg音视频开发深度指南
  • uniapp使用ui.request 请求流式输出
  • 【基于 LangChain 的异步天气查询3】OpenWeather实现实时天气查询
  • Java—— 集合 List
  • 真人配音与AI创作有声读物
  • D. Apple Tree Traversing 【Codeforces Round 1023 (Div. 2)】
  • LeetCode 热题 100 138. 随机链表的复制
  • 实验四:网络编程
  • 如何理解编程中的递归、迭代与回归?