小编use*_*635的帖子

有没有办法用jquery将元素移到其父元素之外?

我的结构是这个html:

<div class="aside_listings">
     <div>
          <div>
               <!--a bunch of content-->
          </div>
     </div>
     <div class="toolbar search_options">
          <!--a bunch more content-->
     </div>
</div>
Run Code Online (Sandbox Code Playgroud)

CSS

.aside_listings {
height: 483px;
width: 440px;
overflow-y: scroll;
overflow-x: hidden;
margin-top: 24px;
}
Run Code Online (Sandbox Code Playgroud)

所以上面的代码按照需要的方式工作,我需要一个滚动页面,因为它是一个非常长的产品列表.在列表的底部是一个搜索栏(第1页,第2页,第3页等),我需要在'.aside_listings'div之外.这都是由我无法触及的代码生成的.我在css中查找了如何执行此操作,并将这些样式添加到'.search_options'中

position: absolute;
margin-top: -50px;
font-size: 18px;
color: #999999;
margin-left: 13px;
width: 418px;
Run Code Online (Sandbox Code Playgroud)

表面上看起来似乎有效,但如果您导航到其他页面之一或优化搜索区域,它会根据列表中显示的产品数量跳转.

有没有办法在jquery中将其移到父元素之外?

谢谢

html javascript css jquery

6
推荐指数
1
解决办法
7656
查看次数

标签 统计

css ×1

html ×1

javascript ×1

jquery ×1