Jquery 幻灯片放映中显示的图像的透明背景?
因为所有的图像都有不同的角度,并且都是透明的,所以你可以看到它们都在后面。有没有办法只让上面的图像可见,而把其余的图像隐藏起来?我可以在.js文件或.css中隐藏图像吗 我仍然希望图像是透明的,现在我刚刚添加了一个背景来隐藏所有图像 所以我想我怎样才能使幻灯片中的图像保持透明,而不显示其背后的图像Jquery 幻灯片放映中显示的图像的透明背景?,jquery,Jquery,因为所有的图像都有不同的角度,并且都是透明的,所以你可以看到它们都在后面。有没有办法只让上面的图像可见,而把其余的图像隐藏起来?我可以在.js文件或.css中隐藏图像吗 我仍然希望图像是透明的,现在我刚刚添加了一个背景来隐藏所有图像 所以我想我怎样才能使幻灯片中的图像保持透明,而不显示其背后的图像 函数滑动开关(){ var$active=$(“#slideshow IMG.active”); 如果($active.length==0)$active=$(“#幻灯片显示IMG:last”);
函数滑动开关(){
var$active=$(“#slideshow IMG.active”);
如果($active.length==0)$active=$(“#幻灯片显示IMG:last”);
var$next=$active.next().length?$active.next()
:$(“#幻灯片演示IMG:first”);
$active.addClass('last-active');
$next.css({opacity:1.0})
.addClass(“活动”)
.animate({opacity:1.0},1000,function()){
$active.removeClass('active last active');
});
}
$(函数(){
设置间隔(“滑动开关()”,400);
});
为了避免丢失一张图片,我不得不将最后一个答案的第三行改为
if ($active.is(':nth-last-child(1)')) {
function slideSwitch() {
var $active = $('#slideshow img.active');
if ($active.is(':last')) {
$active.hide().removeClass('active');
$('#slideshow img:first').show().addClass('active');
}else{
$active.hide().removeClass('active').next().show().addClass('active');
}
}
$(function () {
$('#slideshow img').not('.active').hide()
setInterval(slideSwitch, 400);
});
if ($active.is(':nth-last-child(1)')) {