Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#content-inner 内部元素 fixed定位失效,变成了相对父元素 #483

Closed
Akilarlxh opened this issue Feb 1, 2021 · 1 comment
Closed

Comments

@Akilarlxh
Copy link

I want to create a Bug report

Butterfly Information

Butterfly Version:稳定版3.6.0

Platform:windows

Browser:chrome

Expected behavior

fixed定位本该相对于可视窗口进行定位

Actual behavior

但是现在是相对于元素父元素进行定位。
然而又不是每个fixed定位的元素都是如此。

Steps to reproduce the behavior

  1. 通过悬停 首页的 gitcalendar 的各个提交日历(提交信息使用了fixed定位)
  2. 可以看到悬停时出现的提交次数信息出现了偏移。

Screenshots

Website

这是我的网站 https://akilar.top

Describe the bug

目前来看只有在#content-inner里的内容会出现这个问题。从查阅的资料来看推测应该是这个地方为了配合top-img的全局开关使用了transform属性来实现位移。导致后续的堆叠样式失效。我单纯调整计算位置的js没有多少意义,因为底层逻辑是相对于可视窗口并根据悬停位置计算的,但是现在fixed定位相对于父元素了。不管怎么计算。窗口一变动又会偏移。

@jerryc127
Copy link
Owner

你試下找到這個css 然後刪掉

image

jerryc127 added a commit that referenced this issue Feb 1, 2021
fix: 在layout標簽內的元素,如是position: fixed,其相對定位會更改 #482 #483
NasdaqGodzilla added a commit to NasdaqGodzilla/hexo-theme-butterfly that referenced this issue Nov 6, 2024
fix: 在layout標簽內的元素,如是position: fixed,其相對定位會更改 jerryc127#482 jerryc127#483
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants