亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

想要的效果是鼠標移入移出是圖片放大縮小,這種方法為什么不行啊

想要的效果是鼠標移入移出是圖片放大縮小,這種方法為什么不行啊

Echo_Chien 2016-08-09 11:13:10
<!doctype html><html><head><meta charset="utf-8"><title>無標題文檔</title><style>#wed{ width:270px; height:480px;border:1px solid rgba(153,153,153,1);background-image:url(123.JPG)}</style></head><body><div id="wed" onMouseOver="bigg()" onMouseOut="smal()"></div><script>var wed=document.getElementById("wed");? ?// wed.style.backgroundImage="123.JPG";? ?//alert(wed.style.width)function bigg(){? ? ??do(wed.style.width=wed.offsetWidth+5+"px") while(wed.offsetWidth>540) do(wed.style.height=wed.offsetHeight+20+"px") while(wed.offsetHeight>960) setTimeout(bigg,10) }/**/function smal(){ do(wed.style.width=wed.offsetWidth-5+"px") while(wed.offsetWidth<270) do(wed.style.height=wed.offsetHeight-20+"px") while(wed.offsetHeight<480) setTimeout(smal,10) } </script></body></html>
查看完整描述

2 回答

?
qq_非誠勿擾_3

TA貢獻37條經驗 獲得超16個贊

<!doctype html>

<html>

<head>

<meta charset="utf-8">

<title>無標題文檔</title>

<style>

#wed{?

width:270px;?

height:480px;

border:1px solid rgba(153,153,153,1);

background-image:url(123.JPG)

-webkit-transition: all 0.4s ease-in-out;

-moz-transition: all 0.4s ease-in-out;

-o-transition: all 0.4s ease-in-out;

-ms-transition: all 0.4s ease-in-out;

transition: all 0.4s ease-in-out;

}

#wed:hover{

width:540px;

height:960px;

}

</style>

</head>


<body>

<div id="wed">

</div>


</body>

</html>

不知道這樣行不行

查看完整回答
1 反對 回復 2016-08-09
  • Echo_Chien
    Echo_Chien
    主要是使用onmouseover和onmouoseout以及定時器
  • 2 回答
  • 0 關注
  • 1632 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號