課程
/前端開發
/jQuery
/jQuery基礎(三)—事件篇
怎樣使用mouseover為網頁添加鼠標懸停時添加背景圖片?
2016-07-02
源自:jQuery基礎(三)—事件篇 2-4
正在回答
$(ele).mouseover(function?()?{ ????$(this).css('background',?'url(../images/demo.png)?no-repeat?center?center'); });
qq_遠方燈火閃爍_0 提問者
<div id="box">添加圖片</div>
$("#box").mouseover(function(){
$("#box").css({"background-image":"url","background-size:"cover"});
});
舉報
jQuery第三階段開啟事件修煉,掌握對頁面進行交互的操作
1 回答鼠標點擊事件的第三個方法
3 回答有沒有出發鼠標滾輪的事件
3 回答這兩個鼠標事件,我怎么感覺和click沒啥區別??。?!
2 回答為什么這里鼠標點擊也能出發mousedown、mouseup事件呢?
2 回答鼠標在綠框內(紅線外)移動時,冒泡事件觸發次數問題
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網安備11010802030151號
購課補貼聯系客服咨詢優惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號
2016-07-02
$(ele).mouseover(function?()?{ ????$(this).css('background',?'url(../images/demo.png)?no-repeat?center?center'); });2016-07-02
<div id="box">添加圖片</div>
$("#box").mouseover(function(){
$("#box").css({"background-image":"url","background-size:"cover"});
});