我知道onmouseover和onmouseout,以便他们可以在不悬停时盘旋时运行一个函数但是我 不知道如何让他们扩大。 我已经制作了下拉框,但是我无法让它们扩展。 p>
123 em> [不悬停 strong>] < br>
123456789123 em> [悬停期间 strong>] p>
我试过这个: p>
但我想要它 出来 并且不是立即回来,我确信有更好的方法可以做到这一点,因为我不想逐个像素地让它变得更慢,因为这样会使网页瘫痪 p>
DIV>
&lt;!DOCTYPE html&gt;
&lt; head&gt;
&lt; / head&gt;
&lt; body&gt;
&lt; p id =“exp”onmouseover =“over()”onmouseout =“out ()“style =”background-color:#FFD700; width:100px; height:250px;“&gt;
展开我!
&lt; / p&gt;
&lt; button onclick =”run()“&gt; 运行&lt; / button&gt;
&lt; script type =“text / javascript”&gt;
function over(){
document.getElementById(“exp”)。style.width =“250px”;
}
function out(){
document.getElementById(“exp”)。style.width =“100px”;
}
&lt; / script&gt;
&lt; div id =“x”style =“background-color :#0FF“&gt;&amp; emsp;&lt; / div&gt;
&lt; / body&gt;
&lt; / html&gt;
code> pre>