hover和mouseover的区别,为啥我下面的代码效果一样啊
看了这两节理解的是hover=mouseenter+mouseleave ,不冒泡
请看一下我下面的代码,为啥两种方法效果一样呢,按我理解,鼠标移动到.img 或.text层时point应该缩小的啊,为啥只有完全移出wrapper才会变化,求解答,谢谢
<!DOCTYPE html><html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1"> <title></title> <script src="https://www.imooc.com/static/lib/jquery/1.9.1/jquery.js" type="text/javascript" charset="utf-8"></script> <style type="text/css"> .wrapper { width: 300px; height: 300px; border: 1px solid #000; } .img, .text, .point { width: 100px; height: 100px; border: 1px solid #000; margin: 10px; float: left; } </style> </head> <body> <div class="wrapper"> <div class="img"></div> <div class="text"></div> </div> <div class="point"></div> <script type="text/javascript"> $('.wrapper').mouseover(function(e) { $('.point').css('width', '200px') }) $('.wrapper').mouseout(function(e) { $('.point').css('width', '100px') }) // $('.wrapper').hover(function(){// $('.point').css('width','200px')// },function(){// $('.point').css('width','100px')// }) </script> </body></html>