亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

用鼠標事件改變樣式

原創(chuàng) 2018-12-31 00:17:22 243
摘要:<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>鼠標移動事件</title> <style type="text/css"> .box{ width: 200px;
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>鼠標移動事件</title>
<style type="text/css">
.box{
width: 200px;
height: 200px;
border: 1px solid red;
border-radius: 10px;
}
</style>
</head>
<body>
<div onmousemove="mover(this)" onmouseout="out(this)"></div>
<script type="text/javascript">
function mover(m){
m.style.backgroundColor="red";
m.style.borderRadius="100px";
}
function out(o){
o.style.backgroundColor="blue";
o.style.borderRadius="10px";
}
</script>
</body>
</html>


批改老師:天蓬老師批改時間:2018-12-31 16:13:54
老師總結(jié):你的這個事件有點簡單, 其實用偽類:hover, 給這個元素添加上, 也能實現(xiàn)這樣的效果,不是嗎?試試看

發(fā)佈手記

熱門詞條