JQuery
使用exceptaerospace
和添加自动滑块后,我的水平链接无法正常工作automotive
。添加更多超链接,因为由于我的声誉,我无法发布更多 href 链接。
下面是我的jQuery代码:
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');
var $sibs = $active.siblings();
var rndNum = Math.floor(Math.random() * $sibs.length );
var $next = $( $sibs[ rndNum ] );
$active.addClass('last-active');
$next.css({opacity: 0.0})
.addClass('active')
.animate({opacity: 1.0}, 1000, function() {
$active.removeClass('active last-active');
});
}
$(function() {
setInterval( "slideSwitch()", 5000 );
});
html:
<div id="hori">
<ul>
<li><a href="/home/adapco/Desktop/ksa1" target="name">Aerospace</a></li>
<li><a href="/home/adapco/Desktop/ksa2.css" target="name">Automotive</a></li>
</ul>
</div>
CSS:
#slideshow
{
position:relative;
height:500px;
right:-570px;
top:-350px
}
#slideshow img
{
position:absolute;
top:0;
left:0;
z-index:8;
}
#slideshow img.active
{
z-index:10;
}
#slideshow img.last-active
{
z-index:9;
}