惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Microsoft Azure Blog
Microsoft Azure Blog
Engineering at Meta
Engineering at Meta
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
F
Fortinet All Blogs
博客园 - 叶小钗
T
Tailwind CSS Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
T
The Exploit Database - CXSecurity.com
Blog — PlanetScale
Blog — PlanetScale
T
Tenable Blog
人人都是产品经理
人人都是产品经理
D
DataBreaches.Net
A
Arctic Wolf
P
Proofpoint News Feed
S
SegmentFault 最新的问题
C
CERT Recently Published Vulnerability Notes
T
Threatpost
Y
Y Combinator Blog
WordPress大学
WordPress大学
L
LINUX DO - 热门话题
酷 壳 – CoolShell
酷 壳 – CoolShell
V
Vulnerabilities – Threatpost
AWS News Blog
AWS News Blog
小众软件
小众软件
U
Unit 42
云风的 BLOG
云风的 BLOG
美团技术团队
S
Securelist
C
Cybersecurity and Infrastructure Security Agency CISA
L
LangChain Blog
G
GRAHAM CLULEY
P
Proofpoint News Feed
I
Intezer
Security Latest
Security Latest
L
Lohrmann on Cybersecurity
NISL@THU
NISL@THU
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
The Hacker News
The Hacker News
Cisco Talos Blog
Cisco Talos Blog
T
The Blog of Author Tim Ferriss
H
Heimdal Security Blog
T
Tor Project blog
MongoDB | Blog
MongoDB | Blog
The Cloudflare Blog
T
Troy Hunt's Blog
Know Your Adversary
Know Your Adversary
博客园 - 司徒正美
Google Online Security Blog
Google Online Security Blog
V
V2EX
Application and Cybersecurity Blog
Application and Cybersecurity Blog

博客园 - Cheek G

JQuery常用方法一览 6 bytes !! IE判定 项目小记: IFRAME引起内存泄露的解决方法 - Cheek G wcf中使用Session 整人小程序【转自CSDN】 WF学习日记(一) Asp.net MVC框架学习【收藏】 Web Services 学习【收藏】 输出CSV文件并直接打开时出现SYLK异常 JS 其他(二) - Cheek G JS 其他 - Cheek G JS验证类(一) 非常NB的sql2005分页 web页局部打印 - Cheek G - 博客园 asp.net在ie7中使用FileUpload上传前预览图片 - Cheek G - 博客园 DIV背景半透明,DIV中的字不半透明 - Cheek G - 博客园 IIS 7 中默认页设置的小问题 文件的ContentType类型 小全 页面加载完成前显示LOADING....
js等比例缩放图片 - Cheek G - 博客园
Cheek G · 2008-10-12 · via 博客园 - Cheek G

 有时网页很容易被大图片撑开,下面的小技巧可以用来解决这个问题:<script language="JavaScript" type="text/javascript">
 <!-- 
function DrawImage(ImgD,FitWidth,FitHeight){
     var image=new Image();
     image.src=ImgD.src;
     if(image.width>0 && image.height>0){
         if(image.width/image.height>= FitWidth/FitHeight){
             if(image.width>FitWidth){
                 ImgD.width=FitWidth;
                 ImgD.height=(image.height*FitWidth)/image.width;
             }else{
                 ImgD.width=image.width; 
                ImgD.height=image.height;
             }
         } else{
             if(image.height>FitHeight){
                 ImgD.height=FitHeight;
                 ImgD.width=(image.width*FitHeight)/image.height;
             }else{
                 ImgD.width=image.width; 
                ImgD.height=image.height;
             } 
        }
     }
 }
 //-->
 </script>

<img src="XXXX" alt="自动缩放后的效果"  onload="javascript:DrawImage(this,"200","200");" />