Closed clark-t closed 5 years ago
BUG 描述 MIP.viewer.page.scrollToHash 在锚点节点存在 position: relative 祖先元素时会导致锚点不准确,错误原因基本定位是 MIP.viewer.page.scrollToHash 方法中获取锚点节点的 offsetTop 方式不对,应该沿着 offsetParent 逐渐将 offsetTop 累积起来获得。
复现步骤
<div class="bias"></div> <div class="position-relative"> <div id="target"></div> </div>
期望结果 可以仿造 Jquery offset().top 的计算方法实现
截图 如果合适,添加问题相关的截图
环境及版本信息:
其他信息 其他补充信息
done
BUG 描述 MIP.viewer.page.scrollToHash 在锚点节点存在 position: relative 祖先元素时会导致锚点不准确,错误原因基本定位是 MIP.viewer.page.scrollToHash 方法中获取锚点节点的 offsetTop 方式不对,应该沿着 offsetParent 逐渐将 offsetTop 累积起来获得。
复现步骤
期望结果 可以仿造 Jquery offset().top 的计算方法实现
截图 如果合适,添加问题相关的截图
环境及版本信息:
其他信息 其他补充信息