gpt4 book ai didi

jquery - 链接在水平菜单中不起作用

转载 作者:行者123 更新时间:2023-11-28 14:03:50 26 4
gpt4 key购买 nike

使用 JQuery 添加自动 slider 后,我的水平链接无法正常工作除了 航空航天汽车。添加更多超链接,因为我的名誉无法发布更多 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;
}

检查此链接 http://jsfiddle.net/KyRus/20/

最佳答案

您有一个 ID 为“slideshow”的 div,其中包含一些图像。此 DIV 位于菜单链接的绝对 ONTOP 位置 - 因此您不能按链接。因此,您要么需要将幻灯片放映位置不同,要么也使菜单位置成为绝对位置。

希望对您有所帮助:)

关于jquery - 链接在水平菜单中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10105647/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com