gpt4 book ai didi

jquery - 如何用另一个 div 包裹一个 div - jQuery Wrap

转载 作者:太空宇宙 更新时间:2023-11-04 15:54:59 26 4
gpt4 key购买 nike

完整编辑:

如何用另一个 div 包装一个 jquery div?

样本:有

        this.vpath = $('<div/>', {
'class': 'rollbar-path-vertical'
});

在一个 jquery 脚本中...

现在我试着用这个:

$('.rollbar-path-vertical').wrapAll('<div class="path-fix" />');

要使 .rollbar-path-vertical 位于另一个名为 .path-fix 的 div 中...我做错了什么?我要疯了...谢谢你的紧张和时间。

CSS:

    .path-fix {
position: absolute;
width: 15px;
}

.rollbar-path-vertical {
right: 5px;
top: 0px;
height: 100%;
width: 15px;
position: fixed;
margin: 8px -5px;
border-radius: 0px;
}

最佳答案

编辑:

尝试从 .path-fix 中移除绝对位置,看看是否能让你更接近。

.path-fix {
width:15px;
}

关于jquery - 如何用另一个 div 包裹一个 div - jQuery Wrap,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10640592/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com