课程
/前端开发
/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 回答有没有出发鼠标滚轮的事件
2 回答为什么这里鼠标点击也能出发mousedown、mouseup事件呢?
3 回答这两个鼠标事件,我怎么感觉和click没啥区别?!!!
2 回答鼠标在绿框内(红线外)移动时,冒泡事件触发次数问题
购课补贴联系客服咨询优惠详情
慕课网APP您的移动学习伙伴
扫描二维码关注慕课网微信公众号