FinalData工具栏可能会在扫描到已删除文件较多的时候有点碍眼,工具栏的尺寸相对来说还是有点大,而且工具栏的操作都可以在菜单中找到,所以隐藏工具栏也是挺不错的。FinnalData隐藏......
2017-05-04 205 FinalData
由于页面空间有限,图片常常先只显示缩约图,而用户往往要看清晰的大图,所以就必须把图片放大,以下是 Javascript实现的图片缩放实例,保存为html文件即可预览。
<html>
<head>
<title>图片大小缩放</title>
<style type="text/css">
.imgShow{width:680px; height:500px; overflow-x:scroll; overflow-y:scroll; margin- bottom:20px; overflow:hidden;}
</style>
</head>
<body onload="init()">
<h3>图片缩放</h3>
<div class="imgShow"><img alt="js轻松实现图片缩放" /></div>
<div>
<input type="button" value="放 大" onclick="zoomOut (1.5)" />
<input type="button" value="缩 小" onclick="zoomIn (1.5)" />
<input type="button" value="重 置" onclick="resetImg()" />
</div>
<script language="JavaScript" type="text/javascript">
var originalW = 0,originalH = 0,currentW = 0,currentH = 0;
var img = document.getElementById("img");
function init(){
currentW = img.width;
currentH = img.height;
originalW = currentW;
originalH = currentH;
}
function zoomOut(n){
img.width = currentW * n;
img.height = currentH * n;
UpdateCurrent();
}
function zoomIn(n){
img.width = currentW/n;
img.height = currentH/n;
UpdateCurrent();
}
function resetImg(){
img.width = originalW;
img.height = originalH;
UpdateCurrent();
}
function UpdateCurrent(){
currentW = img.width;
currentH = img.height;
}
</script>
</body>
</html>
标签: js图片缩放
相关文章
FinalData工具栏可能会在扫描到已删除文件较多的时候有点碍眼,工具栏的尺寸相对来说还是有点大,而且工具栏的操作都可以在菜单中找到,所以隐藏工具栏也是挺不错的。FinnalData隐藏......
2017-05-04 205 FinalData
Photoshop cs5之如何画虚线,怎样用Photoshop cs5画虚线?相信很多新手都会遇到这样的问题,其实很简单,用画笔工具就可以实现,今天小编就向大家介绍一下怎样用Photoshop cs5画虚线。希望能......
2016-10-11 204 photoshop photoshop源代码 photoshop技巧
360安全卫士软件受到了许多用户的喜欢,当用户在使用的电脑时发现自己的c盘空间不足,想要将其清理了却不知道具体的操作方法,其实这个问题的操作方法是很简单的,用户在软件中......
2024-01-02 204 360安全卫士清理c盘空间
1、打开美图秀秀,点击最下面的批处理,如果没有安装,美图秀秀会提示,并且帮你安装。 2、在美图秀秀批处理的界面上,我们点击左边的添加多张图片,选择自己要加水印的图片 3、然后我......
2016-07-08 204 美图秀秀
简介:QQ可以截图,输入法可以截图,windows操作系统可以截图,实际上浏览器也可以截图。可以讲,大部分软件都有截图功能。 一.火狐浏览器可以截图 二.360浏览器也可以截图......
2023-05-04 221 浏览器截图