//图片自动调整的模式,1为按比例调整 ,2 按大小调整。 var resizemode = 1 function imgresize(o) { if (resizemode == 2 || o.onmousewheel) { if (o.width > 500) { o.style.width = '500px'; } if (o.height > 800) { o.style.height = '800px'; } } else { var parentNode = o.parentNode.parentNode if (parentNode) { if (o.offsetWidth >= parentNode.offsetWidth) o.style.width = '98%'; } else { var parentNode = o.parentNode if (parentNode) { if (o.offsetWidth >= parentNode.offsetWidth) o.style.width = '98%'; } } } } function bbimg(o) { var zoom = parseInt(o.style.zoom, 10) || 100; zoom += event.wheelDelta / 12; if (zoom > 0) o.style.zoom = zoom + '%'; return false; } function imgzoom(img, maxsize) { var a = new Image(); a.src = img.src if (a.width > maxsize * 4) { img.style.width = maxsize; } else if (a.width >= maxsize) { img.style.width = Math.round(a.width * Math.floor(4 * maxsize / a.width) / 4); } return false; }