Skip to content

Conversation

@fanerge
Copy link

@fanerge fanerge commented Oct 17, 2018

进行优化一下:
fix当页面有滚动条时定位不准确,
采用relative+absoluete定位体系,
支持列表多个元素hover效果

@cht8687
Copy link
Owner

cht8687 commented Oct 19, 2018

@fanerge Thank for the contribution. I will review this change soon.

@cht8687
Copy link
Owner

cht8687 commented Oct 28, 2018

@shineli1984

What do you think about this change?

shiftY = 0
}
updatedStyles = { ...hoverComponentStyle, top: cursorY + shiftY, left: cursorX + shiftX }
updatedStyles = { ...hoverComponentStyle, top: cursorY + shiftY - domPos.y, left: cursorX + shiftX - domPos.x }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to https://caniuse.com/#search=getBoundingClientRect, the return value for getBoundingClientRect lacks x and y for ie and edge, we can use left and top to cover these 2 browsers.

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

Successfully merging this pull request may close these issues.

3 participants