Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
152 views
in Technique[技术] by (71.8m points)

html - css overflow 'auto' on edge

I need to hide the overflow scroll bar on Edge.

I have the current properties on the required scroll area and it's working in macos chrome/safari.

height: "240px", maxHeight: "240px", overflowY: "auto"

I also added the following

  html {
    -ms-overflow-style: -ms-autohiding-scrollbar;
  }

Desire Behavior The scroll bar should hide, unless user is scrolling.

How can I auto hide the bars?

enter image description here

question from:https://stackoverflow.com/questions/65661435/css-overflow-auto-on-edge

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Add these attributes to the container:

onmouseover="this.style.overflowY='scroll'" onmouseout="this.style.overflow='hidden'"

And set set overflow: hidden;.

Codepen: https://codepen.io/manaskhandelwal1/pen/GRjXmQW


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...