【问题标题】:scroll progress bar but for horizontal scrolling滚动进度条,但用于水平滚动
【发布时间】:2021-03-28 18:37:41
【问题描述】:

我正在尝试制作一个滚动进度条,就像 https://scrollprogressbar.github.io/ 提供的那样。 唯一的问题是我的网站已经翻转,所以我可以进行水平滚动。

.wrapper-wrapper {
  width: 100vh;
  height: 100vw;
  transform: rotate(-90deg) translateX(-100vh);
  transform-origin: top left;
  overflow-y: scroll;
  overflow-x: hidden;
  position: absolute;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.wrapper {
  display: flex;
  flex-direction: row;
  width: 400vw;
  transform: rotate(90deg) translateY(-100vh);
  transform-origin: top left;
}
<div class="wrapper-wrapper">
  <div class="wrapper"></div>
</div>

简而言之,我的网站水平滚动,因此它不会给出垂直值,从而导致滚动进度条无能为力。我该怎么办?

【问题讨论】:

标签: javascript html css


【解决方案1】:

使用这个。

scroll-direction: horizontal;

文档链接:https://css-tricks.com/pure-css-horizontal-scrolling/

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-06-26
    • 1970-01-01
    • 2017-11-06
    • 2012-09-16
    • 2016-05-28
    • 2020-10-18
    • 1970-01-01
    • 2014-01-25
    相关资源
    最近更新 更多