jquery鼠标移入移出事件显示div

<li class="active"> <div class="PartR"> </div></li>
<script type="text/javascript">
$(function (){
//显示隐藏
var color ="";
$(".active").mouseover(function (){//鼠标移入
color = $(this).css("background-color");//获取原始颜色
$(this).css("background-color","#5FB878")
$(".PartR").show();//显示
}).mouseout(function (){//鼠标移出
$(this).css("background-color",color)
$(".PartR").hide();//隐藏
});
});
</script>

posted @ 2022-10-17 16:29  疯子110  阅读(545)  评论(0编辑  收藏  举报