<html>
<head>
<title>鼠标经过事件</title>
</head>
<script src="jquery-1.3.1.js" type="text/javascript">
</script>
<style type="text/css">
.orange{
background-color:blue;
font-size:20px;
}
.bo{
background-color:#ff8800;
font-size:20px;
}
</style>
<script type="text/javascript">
//jQuery的格式:$(function(){
// });
$(function(){
$("ul li:eq(1)").mouseover(function(){
$("ul li:eq(1)").addClass("orange")
});
$("ul li:eq(1)").mouseout(function(){
$("ul li:eq(1)").removeClass("orange")
});
$("ul li:eq(1)").click(function(){
$("ul li:eq(1)").toggleClass("bo")
});
});
</script>
<body>
<ul>
<li title='苹果'>苹果</li>
<li title='橘子'>橘子</li>
<li title='菠萝'>菠萝</li>
</ul>
</body>
</html>
<head>
<title>鼠标经过事件</title>
</head>
<script src="jquery-1.3.1.js" type="text/javascript">
</script>
<style type="text/css">
.orange{
background-color:blue;
font-size:20px;
}
.bo{
background-color:#ff8800;
font-size:20px;
}
</style>
<script type="text/javascript">
//jQuery的格式:$(function(){
// });
$(function(){
$("ul li:eq(1)").mouseover(function(){
$("ul li:eq(1)").addClass("orange")
});
$("ul li:eq(1)").mouseout(function(){
$("ul li:eq(1)").removeClass("orange")
});
$("ul li:eq(1)").click(function(){
$("ul li:eq(1)").toggleClass("bo")
});
});
</script>
<body>
<ul>
<li title='苹果'>苹果</li>
<li title='橘子'>橘子</li>
<li title='菠萝'>菠萝</li>
</ul>
</body>
</html>