abstract:實在設(shè)計不出什么好案例,就寫了兩個事件:1--鼠標(biāo)點擊input框后,框會放大,點擊空白處,框恢復(fù)正常;2--鼠標(biāo)懸停在div,該div放大,移開后div恢復(fù)正常,代碼如下:<!doctype html> <html> <head> <meta charset="utf-8"> <title&g
實在設(shè)計不出什么好案例,就寫了兩個事件:
1--鼠標(biāo)點擊input框后,框會放大,點擊空白處,框恢復(fù)正常;
2--鼠標(biāo)懸停在div,該div放大,移開后div恢復(fù)正常,代碼如下:
<!doctype html> <html> <head> <meta charset="utf-8"> <title>js事件作業(yè)</title> </head> <body> <script type="text/javascript"> function myfocus(a){ a.style="margin-left:50px; width:200px; height:30px;" //點擊后input框變大 } function myblur(b){ b.style="margin-left:50px; width:200px; height:15px;" //失去焦點后恢復(fù)正常 } </script> <input type="text" style="margin-left:50px; width:200px; height:15px;" onfocus="myfocus(this)" onblur="myblur(this)"> </br> <script> function mymouseover(c){ c.style="margin:10px auto; width:160px; height:200px; background:orange" //假裝這是一張美嬌娘,鼠標(biāo)懸停圖片放大; } function mymouseout(d){ d.style="margin:10px auto; width:80px; height:100px; background:orange" //鼠標(biāo)移開恢復(fù)正常; } </script> <div style="margin:10px auto; width:80px; height:100px; background:orange" onmouseover="mymouseover(this)" onmouseout="mymouseout(this)" > </div> </body> </html>
Correcting teacher:韋小寶Correction time:2019-01-03 16:39:05
Teacher's summary:恩!已經(jīng)寫的很不錯了!繼續(xù)加油吧!騷年!