?? picture21.htm
字號:
<html>
<!-- Mirrored from www.yesky.com/imagesnew/software/jscript/picture21.htm by HTTrack Website Copier/3.x [XR&CO'2007], Tue, 15 Apr 2008 09:00:16 GMT -->
<head>
<title>自動顯示圖片屬性</title>
<style type="text/css">
<!--
body { font-family: "宋體"; font-size: 9pt; margin-top: 0px; margin-left: 0px; margin-right: 0px}
A { COLOR: black; FONT-SIZE: 13px; FONT-WEIGHT: 400; TEXT-DECORATION: none }
A:hover { COLOR: red; FONT-SIZE: 13px; FONT-WEIGHT: 400; TEXT-DECORATION: underline }
a:active { font: 9pt "宋體"; cursor: hand; color: #FF0033 }
-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function checkImage(loc) {
loc = "image-popup.html?" + loc;
windowprops = 'menubar=0,toolbar=0,status=0,location=0';
popupWindow = open(loc, 'previewWin', windowprops);
if (popupWindow.opener == null)
popupWindow.opener = self;
}
// End -->
</script>
</head>
<body >
<br>
<br>
<center><font color=red face="隸書" size=6>自動顯示圖片屬性</font></center>
<br>
<br><center>
<table border=5 bordercolor=black borderlight=green>
<tr><td align=center><font size=5 color=red face="Arial, Helvetica, sans-serif"><strong>下面框中為腳本顯示區</strong></font></td></tr>
<tr><td align=center>
<form name=dimform>
請輸入你所要顯示的圖片的路徑:<br>
<input type=text name=url size=40 value="http://">
<input type=button value="OK" onClick="checkImage(this.form.url.value);">
<p>
檢測結果:<p>
寬度 = <input type=text name=width><br>
高度 = <input type=text name=height>
</form>
</td></tr></table></center>
<br>
<br>
<center>
<textarea name=source rows=12 cols=55 class=yk9>
腳本說明:
第一步:把如下代碼加入
<!-- Mirrored from www.yesky.com/imagesnew/software/jscript/picture21.htm by HTTrack Website Copier/3.x [XR&CO'2007], Tue, 15 Apr 2008 09:00:16 GMT -->
<head>區域中
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function checkImage(loc) {
loc = "image-popup.html?" + loc;
windowprops = 'menubar=0,toolbar=0,status=0,location=0';
popupWindow = open(loc, 'previewWin', windowprops);
if (popupWindow.opener == null)
popupWindow.opener = self;
}
// End -->
</script>
第二步:把如下代碼加入<body>區域中
<form name=dimform>
請輸入你所要顯示的圖片的路徑:<br>
<input type=text name=url size=40 value="http://">
<input type=button value="OK" onClick="checkImage(this.form.url.value);">
<p>
檢測結果:<p>
寬度 = <input type=text name=width><br>
高度 = <input type=text name=height>
</form>
第三步:新建image-popup.html的文件,其代碼如下:
<HTML>
<!-- Mirrored from www.yesky.com/imagesnew/software/jscript/picture21.htm by HTTrack Website Copier/3.x [XR&CO'2007], Tue, 15 Apr 2008 09:00:16 GMT -->
<HEAD>
<SCRIPT LANGUAGE="JavaScript1.1">
<!-- Begin
imageerror = 0;
function allDone() {
width = (!imageerror) ? document.images[0].width : "error";
height = (!imageerror) ? document.images[0].height : "error";
opener.document.dimform.width.value = width;
opener.document.dimform.height.value = height;
timerID = window.setTimeout('window.close();', 2000);
}
function complain() {
imageerror = 1;
alert('Error loading that image. Please correct the image URL and try again.');
timerID = window.setTimeout('window.close();', 2000);}
// End -->
</SCRIPT>
</HEAD>
<BODY onLoad="allDone();">
<script language="JavaScript">
<!-- Begin
query = location.search;
url = query.substring(1, query.length);
document.write("<img src='" + url + "' onError='complain();'>");
// End -->
</script>
<P>
Loading image.... Reading dimensions....
</body>
<!-- Mirrored from www.yesky.com/imagesnew/software/jscript/picture21.htm by HTTrack Website Copier/3.x [XR&CO'2007], Tue, 15 Apr 2008 09:00:16 GMT -->
</HTML>
</textarea>
<SCRIPT LANGUAGE="JavaScript">
<!-- hide
function goHist(a)
{
history.go(a);
}
//-->
</script>
<FORM METHOD="post">
<INPUT TYPE="button" VALUE="返回" onClick="goHist(-1)" >
</form>
</center>
<br>
<br>
</body>
<!-- Mirrored from www.yesky.com/imagesnew/software/jscript/picture21.htm by HTTrack Website Copier/3.x [XR&CO'2007], Tue, 15 Apr 2008 09:00:16 GMT -->
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -