jquery - 关于我的 CSS 的一些东西阻止了我的图像视差滚动

标签 jquery html css

我不确定是什么东西阻止了我的视差正常滚动。我在网上抓取了一些代码来制作一个粘性侧边栏,并且相信问题出在其中的某个地方,因为我之前已经成功地完成了视差。这是导入的代码。

body,html,.row-offcanvas {


height:100%;
}

#sidebar {
  width: inherit;
  min-width: 220px;
  max-width: 220px;
  background-color:#f5f5f5;
  float: left;
  height:100%;
  position:relative;
  overflow-y:auto;
  overflow-x:hidden;
}
#main {
  height:100%;
  overflow:auto;
}

/*
 * off Canvas sidebar
 * --------------------------------------------------
 */
@media screen and (max-width: 768px) {
  .row-offcanvas {
    position: relative;
    -webkit-transition: all 0.25s ease-out;
    -moz-transition: all 0.25s ease-out;
    transition: all 0.25s ease-out;
    width:calc(100% + 220px);
  }

  .row-offcanvas-left
  {
    left: -220px;
  }

  .row-offcanvas-left.active {
    left: 0;
  }

  .sidebar-offcanvas {
    position: absolute;
    top: 0;
  }
}

这是我要开始工作的视差 div。

.stairsImage
{
  background: url('../images/stairs1.jpg') no-repeat center center fixed;
  background-size: cover;
  width: 100%;
  height: 37.5em;
 }

谢谢!

最佳答案

你能创建一个 jsfiddle 吗?

不管怎样,你后台网址上的“fixed”确实值得怀疑

关于jquery - 关于我的 CSS 的一些东西阻止了我的图像视差滚动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32430078/

相关文章:

php - 替换 heredoc 语法

javascript - 如何将点击功能链接到 React 应用程序中的另一个组件?

css - 根据内容制作 div 大小并在其父级内水平居中

css - Bootstrap 4 - 汉堡包菜单不会出现在移动设备上

android - Android设备上隐藏了滚动条,如何显示垂直滚动条?

javascript - jQuery 缓慢更改 css 属性

javascript - 在javascript中转换每个数组值ias对象不起作用

javascript - 为什么 jQuery 对复选框选中的属性抛出 undefined ?

jquery - jQuery 中 DOM 更改后,单击事件未触发

javascript - HTML5 Canvas ,适合屏幕(其余部分)