想看到这个例子,你需要有39-1.jpg,39-2.jpg的图片,然后复制一下代码到记事本中,然后另存为html格式就可以了 code<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" / ><title >图像浏览</title><script language="javascript" type="text/javascript" style="border-right: white 5px dotted; border-top: white 5px dotted; border-left: white 5px dotted; border-bottom: white 5px dotted;"><!--function load(){window.Text2.value = document.images[0].width;window.Text3.value = document.images[0].height;document.images[0].width = document.body.clientWidth-35;} function resize(){document.images[0].width = document.body.clientWidth-35;} function Submit1_onclick() { document.images[0].width = document.images[0].width * 1.1;} function Submit2_onclick() { document.images[0].width = document.images[0].width * 0.9;} function Submit3_onclick() {document.images[0].width = document.body.clientWidth-35;} function Submit4_onclick() {document.images[0].width = window.Text2.value;} function Button1_onclick() {window.Text1.value ="1";document.images[0].src = "39-1.jpg"; } function Button4_onclick() {window.Text1.value ="2";document.images[0].src = "39-2.jpg"; } function Button2_onclick() {var n = window.Text1.value ;n--;if(n<1)n=1;window.Text1.value =n;if(n==1)document.images[0].src = "39-1.jpg"; if(n==2)document.images[0].src = "39-2.jpg"; } function Button3_onclick() {var n = window.Text1.value ;n++;if(n>2)n=2;window.Text1.value =n;if(n==1)document.images[0].src = "39-1.jpg"; if(n==2)document.images[0].src = "39-2.jpg"; } // --></script></head> <body bgcolor =DimGray onload = "return load()" onresize ="return resize()"> <label ><input name="Submit" type="submit" value=" 放大 " />像素</body></html> 相关文章: 2021-12-05 2022-01-03 2022-12-23 2021-10-03 2021-09-15 2022-12-23 2022-12-23