hover事件中同时设置多个css属性出错
这个代码有问题吗,设置单个css属性时还有效果,设置两个属性就没效果了
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title></title>
<style>
.box{width: 100px;height: 100px;border: 2px solid red ;position: absolute;left: 300px;top: 300px;}
</style>
<script src="https://www.imooc.com/static/lib/jquery/1.9.1/jquery.js"></script>
</head>
<body>
<div class="box"></div>
<script type="text/javascript">
$('.box').hover(
function(){
$(this).css("width":"150px","color":"red");
},
function(){
$(this).css('width':'100px',"color":"white");
}
);
</script>
</body>
</html>