hover事件中同時設(shè)置多個css屬性出錯
這個代碼有問題嗎,設(shè)置單個css屬性時還有效果,設(shè)置兩個屬性就沒效果了
<!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="http://idcbgp.cn/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>
2018-07-17