想用JS做一个压缩文件的JSP页面!!希望能压缩到20K以内!希望各位大侠给小弟一些代码!!!!
解决方案 »
- javascriptMVC 如何使用?
- 网页中如何实现如本网站的“待解决、已解决、推荐[精华]排行榜、版主管理”这样。。。
- js 如何判断当前页面 取消页面所有class
- 郁闷死我了,帮忙看下这个函数哪里出问题了?
- js如何解释json????不用jquery
- 在javascript中,if...else if...else可以弄多少级呀
- 救急:如何把实现jsp页面的内容发送给servlet
- 是否可以在页面的onload()事件中,做一些判断,根据结果重定向到另一个页面?
- 页面弹出时播放mp3怎么实现??javascript
- What's "[^ -z]" and "ig"?
- 花钱请高手搭建myeclipse+tomcat+sqlserver2000
- 社区左边的树状菜单是异步加载的么?搜索如何实现的啊?
示例:
http://dean.edwards.name/packer/你问的是js压缩图片没有用过!DC围观一下
<script 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>onload="javascript:DrawImage(this,140,125);"
js是做不到的.
JavaScript 绘图框架 http://www.liquidx.net/plotkit/