javascript - 与 jquery animate 重叠的 div

标签 javascript jquery html jquery-animate

我正在使用 jquery animate() 增加和减少“行”的大小。有时该行上有一个徽章。现在,徽章在动画过程中隐藏的方式非常丑陋。已经尝试了很多东西以及 z-index 等。但不知道如何解决这个问题。 “徽章”应该留在那里而不隐藏。

Working jsfiddle

有什么建议吗?

最佳答案

我的解决方案要求您将徽章 div 移至第一个 div。希望这样可以吗?

<div style="width:100%;height:50px;border: 1px solid red;background:grey;">

    <div style="left: -moz-calc(100% - 90px); left: -webkit-calc(100% - 90px); left: calc(100% - 90px); top:25px; width:100px; height:50px; position:relative; background-repeat: no-repeat; background-size: contain; background-image:url('http://thumbs.dreamstime.com/z/winner-badge-81762.jpg');"></div>

</div>

<div id="openrow" style="width:100%; height:50px; border: 1px solid red; background:red;">
</div>

<button onclick="start();">Start</button>

https://jsfiddle.net/u0u6gsjn/12/

关于javascript - 与 jquery animate 重叠的 div,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33659004/

相关文章:

javascript - 方法执行后再次循环程序

javascript - select2 无法在带有母版页的 aspx 页面中工作

javascript - JayData 提供程序无法加载 sqLite 和 indexedDb

android - <select> 框未在 PhoneGap 的 Android 上显示

javascript - 在输入元素中监听多个事件(React Js)

jquery - 同时突出显示在 jquery 中找到的文本

javascript - jQuery 在大量文本中查找/替换

javascript - 在 javascript 之上显示 html 按钮

javascript - 具有 Web 服务调用的 Html5 应用程序可在模拟器上运行,但不能在设备上运行

javascript - Javascript For 循环问题