我有这个脚本可以在段落内的链接悬停时在段落上显示背景颜色。我不知道该怎么做是在我“取消悬停”后使其返回到原始背景颜色。
$(function(){
$(".box a").hover(function(){
$(this).parent().css('background-color', '#fff200');
});
});
Thanks!
下面的函数的工作原理如下onmouseover
and onmouseout
$(function () {
$(".box a").hover(function () {
$(this).parent().css('background-color', '#fff200');
}, function () {
// change to any color that was previously used.
$(this).parent().css('background-color', '#fff200');
});
});
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)