我使用了 Effect.scale 属性,但图像继续无限制地调整大小。
假设我在图像缩放到指定的完整百分比之间从图像中移除鼠标,然后再次将鼠标光标保持在那里......然后它再次变得更大......同样缩小比例也太多了。
我该如何预防?请帮帮我
<img src="test.gif" id="test"alt="Online Test portal" style="position:absolute;top:935.5px;left:300px" title="online test portal" onmouseover= "new Effect.Scale('test', 150,{scaleX: true, scaleY: true}); return false;" onmouseout="new Effect.Scale('test', 66.67,{scaleX: true, scaleY: true}); return false;" />
最佳答案
您可以使用纯 CSS 来做到这一点。
img { transition: all .2s linear; }
img:hover { transform: scale(1.1); }
关于javascript - 我怎样才能限制该图像不调整超过特定限制,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30645501/