Skip to content

Commit e0396b6

Browse files
author
杩栋胜
committed
Site updated: 2022-10-09 14:22:15
1 parent d03c3e5 commit e0396b6

File tree

1,182 files changed

+36964
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,182 files changed

+36964
-0
lines changed

1.html

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
<!--
2+
3+
Code highlighting produced by Actipro CodeHighlighter (freeware)
4+
http://www.CodeHighlighter.com/
5+
6+
--><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
7+
<html xmlns="http://www.w3.org/1999/xhtml">
8+
<head>
9+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
10+
<title>最新javascript自动按比例显示图片,按比例压缩图片显示</title>
11+
<script type="text/javascript">
12+
function AutoResizeImage(maxWidth,maxHeight,objImg){
13+
var img = new Image();
14+
img.src = objImg.src;
15+
var hRatio;
16+
var wRatio;
17+
var Ratio = 1;
18+
var w = img.width;
19+
var h = img.height;
20+
wRatio = maxWidth / w;
21+
hRatio = maxHeight / h;
22+
if (maxWidth ==0 && maxHeight==0){
23+
Ratio = 1;
24+
}else if (maxWidth==0){//
25+
if (hRatio<1) Ratio = hRatio;
26+
}else if (maxHeight==0){
27+
if (wRatio<1) Ratio = wRatio;
28+
}else if (wRatio<1 || hRatio<1){
29+
Ratio = (wRatio<=hRatio?wRatio:hRatio);
30+
}
31+
if (Ratio<1){
32+
w = w * Ratio;
33+
h = h * Ratio;
34+
}
35+
objImg.height = h;
36+
objImg.width = w;
37+
}
38+
</script>
39+
</head>
40+
<body>
41+
<br />
42+
原图显示(534 X 800)<br />
43+
onload="AutoResizeImage(0,0,this)<br />
44+
<a href="http://p.blog.csdn.net/images/p_blog_csdn_net/feng_sundy/421506/o_09925c7bcead8c60f683298dacf497a6.jpg" target="_blank"><img src="http://p.blog.csdn.net/images/p_blog_csdn_net/feng_sundy/421506/o_09925c7bcead8c60f683298dacf497a6.jpg" border="0" width="0" height="0" onload="AutoResizeImage(0,0,this)" alt="534 X 800"/></a><br/><br />
45+
1.按宽度250压缩,不限制高度 按比例压缩<br />
46+
onload="AutoResizeImage(250,0,this)"<br />
47+
<a href="http://blog.csdn.net/feng_sundy/archive/2008/06/19/2566028.aspx" target="_blank"><img src="http://p.blog.csdn.net/images/p_blog_csdn_net/feng_sundy/421506/o_09925c7bcead8c60f683298dacf497a6.jpg" border="0" width="0" height="0" onload="AutoResizeImage(250,0,this)" alt="250 X 374"/></a><br /><br />
48+
2.按高度250压缩,不限制宽度 按比例压缩<br />
49+
onload="AutoResizeImage(0,250,this)"<br />
50+
<a href="http://blog.csdn.net/feng_sundy/archive/2008/06/19/2566028.aspx" target="_blank"><img src="http://p.blog.csdn.net/images/p_blog_csdn_net/feng_sundy/421506/o_09925c7bcead8c60f683298dacf497a6.jpg" border="0" width="0" height="0" onload="AutoResizeImage(0,250,this)" alt="166 X 250"/></a><br /><br />
51+
3.按高度250宽度250 按比例压缩<br />
52+
onload="AutoResizeImage(250,250,this)"<br />
53+
<a href="http://blog.csdn.net/feng_sundy/archive/2008/06/19/2566028.aspx" target="_blank"><img src="http://p.blog.csdn.net/images/p_blog_csdn_net/feng_sundy/421506/o_09925c7bcead8c60f683298dacf497a6.jpg" border="0" width="0" height="0" onload="AutoResizeImage(250,250,this)" alt="200 X 300"/></a><br /><br />
54+
4.高宽不等比例压缩 (400 X 512),此时高度不变,会自动按高度的比例压缩。<br />
55+
onload="AutoResizeImage(400,512,this)"<br />
56+
<a href="http://blog.csdn.net/feng_sundy/archive/2008/06/19/2566028.aspx" target="_blank"><img src="http://p.blog.csdn.net/images/p_blog_csdn_net/feng_sundy/421506/o_09925c7bcead8c60f683298dacf497a6.jpg" border="0" width="0" height="0" onload="AutoResizeImage(400,512,this)" alt="341 X 512"/></a><br /><br />
57+
5.高宽不等比例压缩 (300 X 600),此时宽度不变,会自动按宽度的比例压缩。<br />
58+
onload="AutoResizeImage(300,600,this)"<br />
59+
<a href="http://blog.csdn.net/feng_sundy/archive/2008/06/19/2566028.aspx" target="_blank"><img src="http://p.blog.csdn.net/images/p_blog_csdn_net/feng_sundy/421506/o_09925c7bcead8c60f683298dacf497a6.jpg" border="0" width="0" height="0" onload="AutoResizeImage(300,600,this)" alt="300 X 449"/></a><br /><br />
60+
6.如果图片本来的高度和宽度小于压缩的最大高度和宽度,则不会拉大显示图片(按原图显示)<br />
61+
原图444 x 207,压缩为 500 x 600,将保持原图显示<br />
62+
onload="AutoResizeImage(500,600,this)"<br />惠山区人才网<a href="http://blog.csdn.net/feng_sundy/archive/2008/06/19/2566028.aspx" target="_blank"><img src="http://p.blog.csdn.net/images/p_blog_csdn_net/feng_sundy/242776/o_20070410_b7409cd284a0f799a357uePcEFa6ty0X.jpg" border="0" width="0" height="0" onload="AutoResizeImage(500,600,this)" alt="444 X 207"/></a><br /><br />
63+
</body>
64+
</html>

404.html

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
406d9d4108045dba7e248bb0d47374e6
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
78da7b3d195bc1866a0a0807dd1faca6
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
9ba0554bc31836cd011f7edf4e88cc40

BingSiteAuth.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0"?>
2+
<users>
3+
<user>F52781D38F42583FE60015C5E56386B2</user>
4+
</users>

CNAME

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
www.mdslq.cn

README.md

Lines changed: 1 addition & 0 deletions

WW_verify_73sCBdnMxy9UwFIe.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
73sCBdnMxy9UwFIe

about/index.html

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)