在过度效果完成之前链接不会激活
我目前正在尝试向我的链接添加悬停淡入效果,并且我已经完成了该操作,但是在效果发生时,链接有几秒钟不处于活动状态。我尝试淡入链接内的 img 元素,但这不起作用。我将 .mouseover() 切换到 .hover() 仍然不起作用。
这是代码:
$(".tabButtons a").mouseover(function() {
$(this).css("opacity","0");
$(this).css("background","url(/testsite/assets/templates/tsi/images/sspButtonHover.png)");
$(this).animate({opacity: 1}, 500);
});
$(".tabButtons a").mouseout(function() {
$(this).stop();
$(this).css("opacity","1");
$(this).css("background","url(/testsite/assets/templates/tsi/images/sspButton.png)");
});
有什么建议吗? 这里是发生这种情况的页面:(有中间是一排灰色的大按钮)
I am currently trying to add a hover fade-in effect to my links, and I have accomplished that, but the links are not active for a few seconds while the effect is taking place. I have tried fading in the an img element inside the link instead, but that did not work. I switched .mouseover() to .hover() still did not work.
Here is the code:
$(".tabButtons a").mouseover(function() {
$(this).css("opacity","0");
$(this).css("background","url(/testsite/assets/templates/tsi/images/sspButtonHover.png)");
$(this).animate({opacity: 1}, 500);
});
$(".tabButtons a").mouseout(function() {
$(this).stop();
$(this).css("opacity","1");
$(this).css("background","url(/testsite/assets/templates/tsi/images/sspButton.png)");
});
Any suggestions?? Here is the page where this is happening:(there is a row of large grey buttons in the middle)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试在
标记内添加
标记,并在
标记上执行所有动画。为您的
和
标记提供固定尺寸。
Try adding a
<span>
tag inside of your<a>
tag and do all of your animation on your<span>
tag. Give your<span>
and<a>
tags fixed dimensions.