Function Hover Case

2018-10-06  本文已影响0人  Jadon7
<div id="rectangle" onmouseover="her()" onmouseout="ovher()"></div>
#rectangle{
  width:100px;
  height:100px;
  background-color:red;
}
var hRectangle=document.getElementById('rectangle').style;
function her()
{
  hRectangle.width='200px';
  hRectangle.height = '200px';
  hRectangle.background='#ccc';
}
function ovher()
{
  hRectangle.width='100px';
  hRectangle.height = '100px';
  hRectangle.background='red';
}
上一篇下一篇

猜你喜欢

热点阅读