标签:
1、结论
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> <style> div{ width: 200px; height: 200px; padding: 5px; border: 1px red solid; } span{ display: inline-block; width: 50px; height: 50px; background: blue; } </style> </head> <body> <div class="over"> <span>0</span> </div> <div class="enter"> <span>0</span> </div> </body> <script src="libs/jquery-1.8.3.min.js"></script> <script type="text/javascript"> $(function(){ var x = 0; var y = 0; $(".over").mouseover(function(){ $(this).find("span").text(x+=1); }); $(".enter").mouseenter(function(){ $(this).find("span").text(x+=1); }) }) </script> </html>
jQuery基础:mouseeter( ) 与 mouseover( ) 区别
标签:
原文地址:http://www.cnblogs.com/gao-xiong/p/5935284.html