热门关键字:
jquery > jquery教程 > div+css > JS鼠标效果

JS鼠标效果

258
作者:管理员
发布时间:2020/5/5 16:45:41
评论数:0
转载请自觉注明原文:http://www.jq-school.com/Show.aspx?id=1536
 1 <!DOCTYPE html>  2 <html lang="en">  3 <head>  4 <meta charset="UTF-8">  5 <title>Document</title>  6 <style type="text/css">  7  #div1{  8  width: 200px;  9  height: 50px; 10  background-color: orange; 11 } 12 </style> 13 <script type="text/javascript"> 14 function toGreen(){ 15  document.getElementById('div1').style.background='green'; 16  } 17 function toOrange(){ 18  document.getElementById('div1').style.background='orange'; 19  } 20 </script> 21 </head> 22 <body> 23 <div id="div1" onmouseover="toGreen()" onmouseout="toOrange()"></div> 24 </body> 25 </html>




如果您觉得本文的内容对您的学习有所帮助:支付鼓励



关键字:JS鼠标
友荐云推荐