使用mouse事件实现简单的鼠标经过特效

前端技术 2023/09/07 JavaScript

代码超级简单,这里就不多BB了,直接奉上

http://ajax.googleapis.com/ajax/libs/jquery/1.4.0/jquery.min.js\"></script>
</head>
<body>
    <h1>鼠标经过下面的块</h1>
    <ul>
        <li></li>
        <li></li>
        <li></li>
        <li></li>
    </ul>
</body>
</html>
<script type=\"text/javascript\">
    $(\"ul li\").mouseover(function()
    {
         $(this).addClass(\"current\");
    }).mouseout(function()   
    {
        $(this).removeClass(\"current\");       
    });
</script>

非常简单的代码,小伙伴们参考下,自由扩展,希望大家能够喜欢。

本文地址:https://www.stayed.cn/item/19867

转载请注明出处。

本站部分内容来源于网络,如侵犯到您的权益,请 联系我

我的博客

人生若只如初见,何事秋风悲画扇。