コードは非常にシンプルで、ここには多くのBBSがありません。
コードコピーは次のとおりです。
<!doctype html>
<html lang = "zh-cn">
<head>
<メタcharset = "utf-8">
<title> document </title>
<style type = "text/css">
ボディ、ul、li {マージン:0;パディング:0;リストスタイル:なし}
ul li {width:100px;高さ:100px;ボーダー:1PXソリッド#F00;フロート:左;マージン:50px 10px;バックグラウンドカラー:#ffffff;}
ul li.current {border:1px solid #dfdfdf;バックグラウンドカラー:#ff0000;}
</style>
<script type = "text/javascript" src = "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")。マウスオーバー(function()
{
$(this).addclass( "current");
})。mouseout(function()
{
$(this).removeclass( "current");
});
</script>
非常にシンプルなコード、それを参照してください、無料拡張機能、私はあなたがそれを好きになることを願っています。