⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 imgresize.js

📁 介绍了外置式USB无损图像采集卡的设计和实现方案
💻 JS
字号:
var imgMaxWidth=600;
function ImgLoad(obj)
{
	for(var i=0;i<obj.getElementsByTagName("img").length;i++){
		var o=obj.getElementsByTagName("img")[i];
		if (o.width>imgMaxWidth){
			if (o.style.width){
				o.style.width="";
			}
			o.width=imgMaxWidth;
			o.removeAttribute("height");
			o.setAttribute("title","ctrl+鼠标滚轮缩放");
			o.style.cursor="hand";
			o.style.display="block";
			o.vspace=5;
			o.resized=1;
			o.onclick=ImgClick;
			o.onmousewheel=bbimg;
		}
	}
}
function ImgClick()
{
	if (this.parentElement){
		if (this.parentElement.tagName!="A"){
			window.open(this.src);
		}
	}else{
		window.open(this.src);
	}
}
function bbimg()
{
	if (event.ctrlKey){
		var zoom=parseInt(this.style.zoom, 10)||100;
		zoom+=event.wheelDelta/12;
		if (zoom>0) this.style.zoom=zoom+'%';
		return false;
	}else{
		return true;
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -