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-03-18 15:54  早早早点睡觉  阅读(452)  评论(0)    收藏  举报