jquery SlideDown 而不是 SlideAndPush

发布于 2024-07-13 06:49:21 字数 95 浏览 5 评论 0原文

我有一个 div,我可以在其中单击幻灯片链接。 正如预期的那样,它实现了它所承诺的功能,但是,我更喜欢它滑开而不将其他元素推下。 就像其他层之上的一层一样。 这可能吗 ?

I have a div where I click on a link to slideDown. As expected it does what it promises however, I prefer it to slide open without pushing the other elements down as well. so like a layer on top of other layers. is this possible ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

翻了热茶 2024-07-20 06:49:21

这是可能的,但并不完全简单。 我之前已经在这里(视频悬停)完成过。

这个概念基本上是这样的:

  1. 设置当前元素的相对位置(浮动的元素,或者它的父元素,如果这样更有意义)。 这可以在 CSS 中静态设置。
  2. 创建一个新元素,使用相同的尺寸对其进行类似的样式设置,并使用 position:absolute 将其定位在当前元素的正上方,并使用 z-index:...
  3. 使用 SlideDown (或再次改变高度,这取决于最有意义的)并且它应该位于其余内容之上

It's possible but not entirely simple. I've done it before here (the video hover-overs).

The concept basically goes:

  1. Set position relative on your current element (the one you're floating, or its parent if that makes more sense). This can be statically set in your CSS.
  2. Create a new element, style it similarly with the same dimensions and position it right above your current element using position:absolute and z-index:...
  3. use slideDown (or alter the height, again, depending on what makes most sense) and it should be above the rest of your content
¢好甜 2024-07-20 06:49:21

尝试浮动你的元素。 如果它们是 div,它们应该互相滑动。

Try floating your elements. If they are div's they should slide over one another.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文