因为所有的图像都有不同的角度,并且都是透明的,所以你可以看到它们都在彼此后面。有没有办法让顶部图像可见,其余部分是隐藏的?我可以将图像隐藏在我的.js文件或.css中吗?从我的幻灯片中显示的图像透明背景?
我仍然希望图像是透明的,现在我只是添加了一个背景去背后的所有图像。
所以我想如何保持幻灯片中的图像透明,但不显示背后的图像。
http://kennenmen.netai.net/test.php
function slideSwitch() {
var $active = $('#slideshow IMG.active');
if ($active.length == 0) $active = $('#slideshow IMG:last');
var $next = $active.next().length ? $active.next()
: $('#slideshow IMG:first');
$active.addClass('last-active');
$next.css({opacity: 1.0})
.addClass('active')
.animate({opacity: 1.0}, 1000, function() {
$active.removeClass('active last-active');
});
}
$(function() {
setInterval("slideSwitch()", 400);
});
<div id="slideshow">
<img src="http://images.lasuni.com/users/5/0/kennen.png" alt="" class="active" />
<img src="http://images.lasuni.com/users/2/0/kennen.png" alt="" />
<img src="http://images.lasuni.com/users/8/0/kennen.png" alt="" />
<img src="http://images.lasuni.com/users/4/0/kennen.png" alt="" />
<img src="http://images.lasuni.com/users/6/0/kennen.png" alt="" />
<img src="http://images.lasuni.com/users/3/0/kennen.png" alt="" />
<img src="http://images.lasuni.com/users/7/0/kennen.png" alt="" />
<img src="http://images.lasuni.com/users/1/0/kennen.png" alt="" />
</div>