使用 jquery SlideDown 在 ipad 上动画完成后 div 标签消失
我正在使用 $('div#MainNavigation').slideDown('medium');
向下滑动 div 标签。 iPad 上的动画完成后,它就会消失。
我使用的网站是 www.missbossyboots.com.au 单击左上角的徽标可激活滑动代码。
I am using $('div#MainNavigation').slideDown('medium');
to slide down a div tag. On completion of the animation on the iPad, it disappears.
The site i'm using this on is www.missbossyboots.com.au Clicking the logo in the top left activates the sliding code.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
对我来说,与 Gavin Bruce 相反,正是因为填充底部,我的 div 消失了!
为了解决这个问题,我只需将 css“overflow:hidden;” 添加到lideUp/slideDown 元素(在我的例子中是一个div)。
For me, contrary to Gavin Bruce, it was because of the padding bottom that my div disappeared!
To fixed it, I simply add a the css "overflow: hidden;" to the slideUp/slideDown element (A div in my case).
我知道我参加聚会迟到了,但我在遇到这个问题时发现了这个问题,加文的评论没有解决我的问题(给定的设计看起来也不会正确)。
当我把头撞在墙上时,因为这在除 IOS Safari 之外的每个浏览器中都能正常工作,我终于发现了我的情况的罪魁祸首:
一个放错位置的
z-index
标签。这是我的代码的“轻型”版本:
最初,我将
z-index: 3000;
应用于元素。
当我将其从 ul 中删除并将其移动到
元素后,我的问题就消失了,并且 ul 在动画结束后留在了它所属的位置。
I know I'm late to the party, but I found this question while I was experiencing this very problem, and Gavin's comment did NOT resolve my issue (nor would it have looked correct with the given design).
While I was banging my head against the wall as this worked properly in every browser out there except IOS Safari, I finally discovered the culprit in MY case:
a misplaced
z-index
tag.Here's the "light" version of my code:
Originally, I had
z-index: 3000;
applied to the<ul>
element.After I removed it from the ul and moved it to the
<div class="children">
element, my problems went away, and the ul stayed where it belonged after the animation.我遇到了相同(或类似)的问题 - 在 jquerylideDown() 转换后内容“跳出”其容器。对我来说,它与 z-index 无关。我通过删除样式“position:relative;”解决了这个问题(使其成为“静态”)用于跳跃的元素。我仍然不清楚为什么会发生这种情况,并且删除position:rel并不总是一个选择。我使用的是 jquery 1.9.1,我不确定这是否是 jquery 中的错误。
I'm having the same (or similar) problem - content is "jumping outside" of it's container after the jquery slideDown() transition. For me, it has nothing to do with z-index. I solved it by removing the style "position:relative;" (making it "static") for the element that is jumping. I'm still unclear to me as to why this is happening, and removing position:relative is not always an option. I'm using jquery 1.9.1, and I'm not sure if this is a bug in jquery.