动画悬停不透明度(jQuery的) [英] Animate opacity on hover (jQuery)
本文介绍了动画悬停不透明度(jQuery的)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我们有一个链接:
<a href="#">
Some text
<span style="width: 50px; height: 50px; background: url(image.png); overflow: hidden; opacity: 0;"></span>
</a>
和我们要改变的不透明度&LT;跨度方式&gt;
有一些动画,当链接悬停
And we want to change opacity of <span>
with some animation, when the link is hovered.
我们会怎么做呢?
推荐答案
这样的:
$('a:has(span)').hover(
function() { $('span', this).fadeIn(); },
function() { $('span', this).fadeOut(); }
);
这篇关于动画悬停不透明度(jQuery的)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文