Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/86.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/40.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
jQuery使用“自动宽度”显示/隐藏幻灯片图像_Jquery_Css_Width_Show Hide - Fatal编程技术网

jQuery使用“自动宽度”显示/隐藏幻灯片图像

jQuery使用“自动宽度”显示/隐藏幻灯片图像,jquery,css,width,show-hide,Jquery,Css,Width,Show Hide,我对CSS和jQuery有一些问题。。 我尝试幻灯片图像隐藏,更改src和幻灯片显示。。。当我使用“宽度”参数时,一切正常,例如500像素,或50%,但我需要宽度:自动和高度100% 代码CSS #gallery img { width:auto; height:100%; max-width:auto; margin:0 auto; display:block; border:none; } #gallery { position:a

我对CSS和jQuery有一些问题。。 我尝试幻灯片图像隐藏,更改src和幻灯片显示。。。当我使用“宽度”参数时,一切正常,例如500像素,或50%,但我需要宽度:自动和高度100%

代码CSS

#gallery img {
    width:auto;
    height:100%;
    max-width:auto;
    margin:0 auto;
    display:block;
    border:none;
}

#gallery { 
    position:absolute;
    width:100%;
    height:auto;
    top:140px;
    bottom:60px;
    margin:0 auto;
    display: block;
    z-index:10;
    overflow:none;
}
和jQuery

$('#gallery').hide("slide", { direction: "left" }, 1000);
$('.gallery_img').attr('src', url);
$('#gallery').show("slide", { direction: "right" }, 1000);
我谷歌chrome一切正常,但IE和firefox不支持这一点,图像在静态时有正确的比例,但当开始滑动宽度更改为自然大小IMG

这个问题有什么解决办法吗?
谢谢

我想你必须设置w/Jquery,而不是css。如果您在css中将宽度设置为100%,那么它将是…100%。

您可以设置一个或来播放吗?谢谢