---
title: "让FCKeditor插入的图片自动缩小"
author: "ktz666"
date: "2009-03-17T16:45:00Z"
tags: [".net", "Blog", "JavaScript", "fckeditor"]
slug: "fckeditor"
draft: false
lastmod: "2009-03-17T16:45:00Z"
id: 559550
url: "https://ktz666.iteye.com/blog/559550"
---

这些终于解决把模板撑大的问题了。

&lt;script language="JavaScript"&gt;  
&lt;!--  
window.onload=fiximage;  
function fiximage() {  
    var max=600;  
    imgs = document.getElementsByTagName('img');  
    for(i=0;i&lt;imgs.length;i++) {  
    w=imgs\[i].width;h=imgs\[i].height;  
    if(w&gt;max) { imgs\[i].width=max;imgs\[i].height=h/(w/max);}  
    }  
}  
//--&gt;  
&lt;/script&gt;

引用地址：http://www.sablog.net/blog/category/technical/