jQuery fadeOut不会更改显示属性 [英] jQuery fadeOut is not changing display property

查看:168
本文介绍了jQuery fadeOut不会更改显示属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

http://judi.simpleupdates.com/上,我试图对图像进行幻灯片显示使用jQuery fadeInfadeOut效果的页面.两项fadeIn都没有问题.但是,fadeOut不会更改应该消失的divdisplay属性.为什么这可能无法按预期工作的任何想法?

On http://judi.simpleupdates.com/ I am attempting to make a slideshow of images on a page using the jQuery fadeIn and fadeOut effects. Both items fadeIn without issue. However, fadeOut is not changing the display property of the div that is supposed to disappear. Any ideas why this might not be working as expected?

这是失败的行:

$( ".carousel_item:nth-child(" + selected + ")" ).fadeOut(600);   

更新:问题似乎出在没有widthheight的元素上的fadeOut.当将值添加到div.carousel_itemwidthheight属性时,fadeOut调用将正常工作.另一种方法是从后代img中删除position: absolute,从而导致div增长到img尺寸.

UPDATE: The issue seems to be with fadeOut on a element that does not have a width and height. When values are added to the width and height properties of div.carousel_item the fadeOut call works properly. Another method is to remove position: absolute from the descendant img causing the div to grow to the img dimensions.

推荐答案

问题似乎出在没有widthheight的元素上的fadeOut.当将值添加到div.carousel_itemwidthheight属性时,fadeOut调用将正常工作.另一种方法是从后代img中删除position: absolute,从而导致div增长到img尺寸.

the issue seems to be with fadeOut on a element that does not have a width and height. when values are added to the width and height properties of div.carousel_item the fadeOut call works properly. another method is to remove position: absolute from the descendant img causing the div to grow to the img dimensions.

感谢您的所有帮助和建议!

thanks for all of your help and suggestions!

这篇关于jQuery fadeOut不会更改显示属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆