【www.bbyears.com--网页配色】
用法:
DrawImage(ImgD,imgwidth) ImgD 为 图片标签的 name imgwidth为图片允许的最大宽度
以下是引用片段:
<% Response.Write "" %>
<script language="javascript">
var flag=true;
function DrawImage(ImgD,imgwidth){
var image=new Image();
image.src="/blog/ImgD.src";
if(image.width>0 && image.height>0){
flag=true;
if(image.width>=imgwidth){
ImgD.width=imgwidth;
ImgD.height=(image.height*imgwidth)/image.width;
}else{
ImgD.width=image.width;
ImgD.height=image.height;
}
}
}
function cgimg(o){
var zoom=parseInt(o.style.zoom, 10)||100;zoom+=event.wheelDelta/12;if (zoom>0)
o.style.zoom=zoom+’%’;
return false;
}
</script>