【发布时间】:2015-04-29 01:06:11
【问题描述】:
我想在鼠标向上放大图像并在鼠标向下缩小图像。我已经尝试过在新窗口中缩放图像的某些部分的插件,但我不需要这些。我希望图像在自己的窗口上放大。请帮忙。
【问题讨论】:
-
看起来落后了,你不觉得吗?
-
鼠标向上和鼠标向下到底是什么意思?
我想在鼠标向上放大图像并在鼠标向下缩小图像。我已经尝试过在新窗口中缩放图像的某些部分的插件,但我不需要这些。我希望图像在自己的窗口上放大。请帮忙。
【问题讨论】:
希望下面的演示有所帮助。
<!DOCTYPE html>
<html>
<body>
<div class="normal">
<img id="p1" src="http://www.hdwallpapersimages.com/wp-content/uploads/2014/01/Winter-Tiger-Wild-Cat-Images.jpg" onmousedown="mouseDown()" onmouseup="mouseUp()" />
</div>
<script>
function mouseDown() {
var m=document.getElementById("p1");
m.style.width="300px";
m.style.height="400px";
}
function mouseUp() {
var m=document.getElementById("p1");
m.style.width="200px";
m.style.height="300px";
}
</script>
<style>
.normal>img
{width: 200px; height: 300px;}
</style>
</body>
</html>
【讨论】: