function resize(thumbs_size) {;
var max = thumbs_size.split('x');;
var fixwidth = max[0];;
var fixheight = max[1];;
imgs = document.getElementsByTagName('img');;
for(i=0;i<imgs.length;i++) {;
w=imgs[i].width;h=imgs[i].height;;
if(w>fixwidth) { imgs[i].width=fixwidth;imgs[i].height=h/(w/fixwidth);};
if(h>fixheight) { imgs[i].height=fixheight;imgs[i].width=w/(h/fixheight);};
imgs[i].style.cursor= "pointer";;
imgs[i].onclick = function() { window.open(this.src);};
if (navigator.userAgent.toLowerCase().indexOf("ie") > -1) {;
imgs[i].title = "点击查看放大图片";;
imgs[i].onmousewheel = function img_zoom() {;
var zoom = parseInt(this.style.zoom, 10) || 100;;
zoom += event.wheelDelta / 12;;
if (zoom> 0) {;
this.style.zoom = zoom + "%";;
return false;;
};
};
};
else {;
imgs[i].title = "点击查看放大图片";;
};
};
}
上一篇 JS评分系统,并提供源码下载
下一篇 js一个输入检测类