jquery样式

1 //Screen  屏幕,显示器左上角
2 //page  页面 当前页面左上角
3 //client  可视区域  显示页面的区域的左上角
4 //offset  元素  元素的左上角

基本事件:

 1     //    $(".child") .click(function(){
 2     //        console.log(0);
 3     //    })
 4     //    $(".child") .mousemove(function(e){
 5     //        console.log(e.offsetX,e.offsetY);
 6     //    })
 7     //    $(".child") .mouseover(function(){
 8     //        $(this).css("background-color","red");
 9     //    })
10     //    $(".child") .mouseout(function(){
11     //        $(this).css("background-color","pink");
12     //    })
13 
14 
15     //    $(".child").hover(function(){
16     //         $(this).css("background-color","red");
17     //    },function(){
18     //        $(this).css("background-color","pink");
19     //    })

阻止事件冒泡:

1  e.stopPropagation();

阻止默认行为:

  e.preventDefault(); 

 

posted @ 2021-11-10 11:58  小小不小阿  阅读(25)  评论(1编辑  收藏  举报