第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定

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>

正在回答

1 回答

<script?type="text/javascript">
?????????$('.box').hover(
?????????????function(){
?????????????$(this).css({"width":"150px","color":"red"});
????????????},
????????????function(){
????????????????$(this).css({'width':'100px',"color":"white"});
????????????}
?????????);
????</script>
????
jquery設(shè)置多個css的屬性是這樣的--->????$("p").css({"background-color":"yellow","font-size":"200%"});???屬性鍵值對是需要用大括號包起來的。


1 回復(fù) 有任何疑惑可以回復(fù)我~
#1

qq_Onecallaway_1 提問者

非常感謝!
2018-07-18 回復(fù) 有任何疑惑可以回復(fù)我~

舉報

0/150
提交
取消

hover事件中同時設(shè)置多個css屬性出錯

我要回答 關(guān)注問題
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號