您的位置 >>> 星想互联 >>> 课堂教学 >>> 教学案例
JQUERY实现MOUSEOVER伪类
点击数:2817  发布时间2013-04-23 21:04:34
<style>
ul li{
float:left;margin-right:10px;width:60px; 
}
.bg{
 background:#f90; display: block;border:1px solid #F00
}
p{
 clear:both;
}
</style>
<script src="jquery.min.js"></script>
<script>
$(function(){
$("li").mouseover(function(){
 $(this).addClass("bg")
})
$("li").mouseout(function(){
 $(this).removeClass("bg")
})
})
</script>
来源:星想互联