gpt4 book ai didi

javascript - jquery 动画不透明箭头 mouseenter mouseleave

转载 作者:太空宇宙 更新时间:2023-11-03 18:13:33 24 4
gpt4 key购买 nike

当我们经过箭头导航时,我正在尝试使用 jquery 添加不透明效果,但似乎没有任何反应:(。你知道我的 Jquery 脚本有什么问题吗。

这是我的 Jquery:

$(document).ready(function(){
$(".flscroll").mouseenter(function(){
$("flscroll").animate({opacity:1},300);
});
$(".flscroll").mouseleave(function(){
$(".flscroll").animate({opacity:.8},300);
});
});

我在我的 CSS 中定义了我的箭头:

.flscroll {
display:block;
height: 83px;
opacity: 0.8;
position: fixed;
top: 40%;
z-index: 1000;
}
.ie8 .flscroll {
filter: alpha(opacity=80);
}
#flscrollg {
background: url(images/sprite.png) no-repeat 50px -100px;
left: -30px;
padding-left: 50px;
width: 52px;
}
#flscrolld {
background: url(images/sprite.png) no-repeat left -200px;
padding-right: 50px;
right: -30px;
width: 53px;
}

我的 html 箭头声明是这样的:

<a href="#1" title="previous" class="flscroll" id="flscrollg">&nbsp;</a>
<a href="#1" title="next" class="flscroll" id="flscrolld">&nbsp;</a>

最佳答案

所以我在评论中提到,这行代码中可能是您​​的 Jquery 缺少句号

$("flscroll").animate({opacity:1},300);
//Should be
$(".flscroll").animate({opacity:1},300);

我在这个FIDDLE里面加了它工作正常。

这就是你想要的吗?

关于javascript - jquery 动画不透明箭头 mouseenter mouseleave,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23218168/

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