粘性订单检查部分woocommerce

问题描述 投票:0回答:1

在将审阅顺序(在这种情况下为查询)部分粘贴到滚动条标题的底部有点麻烦。

我经历了一些没有运气的jquery示例,现在正在处理该元素的粘性位置。使用一个Codepen示例并对其进行操作,就可以使它正常工作,并尝试通过检查器将其复制到页面上,但是没有运气。

Codepen示例

HTML

<main class="main-container">
  <header class="main-header">HEADER</header>
  <div class="main-content">MAIN CONTENT</div>
  <div class="second-content">SECOND CONTENT</div> 
  <footer class="main-footer">FOOTER</footer>
</main>

CSS

body{color:#fff; font-family:arial; font-weight:bold; font-size:40px; }
.main-container{ max-width:1000px; margin:0 auto; border:solid 10px green; padding:10px; margin-top:40px;}
.main-container *{padding:10px;background:#aaa; border:dashed 5px #000;}
.main-container * + *{margin-top:20px;}
.main-header{
  height:50px; background:#aaa; border-color:red;
}
.main-content{
    display:inline-block;
    width:49%;
    height:900px;
}

.second-content{
  display:inline;
  width: 49%;
  height: 200px;
  position: sticky;
  top:0;
}

https://codepen.io/elad2412/pen/QYLEdK

网站URLhttps://trolleys.wpengine.com/

根据我的理解,您需要jQuery来阻止它通过页脚以及正确吗?

我已经尝试了几种不同的方法,并尝试了一些不同的元素,其中一些元素停留了一段时间,但我需要掌握整篇文章。

这是一个最好的例子,可以很好地显示我之后的情况,尝试实现此功能,但无法使其正常工作。http://jsfiddle.net/bryanjamesross/VtPcm/

javascript jquery css woocommerce sticky
1个回答
0
投票

已修复,

不得不给表单一些额外的属性,我正在将它们应用于外部div。

form.checkout {
    height: 1500px;
    position:relative;
    display:block;
}
© www.soinside.com 2019 - 2024. All rights reserved.