Skip to content

图片缩放是个头疼的问题

最近自己再做项目,其中图片处理是一大块,把图片缩放到几种格式的大小,但是到了应用却发现总是不够用,没办法只能google求助了,发现了好的方法:

mg{
width:expression(width>700?”700px”:width);
}

当图片的宽度大于700时。自动按宽度700px自动缩放。

还有一个更好的方法:

    .Image {
max-width:600px;height:auto;cursor:pointer;
border:1px dashed #4E6973;padding: 3px;
zoom:expression( function(elm) {
if (elm.width>560) {
var oldVW = elm.width; elm.width=560;
elm.height = elm.height*(560 /oldVW);
}
elm.style.zoom = '1';
}(this));
}

着两个方法都是在css里实现了图片自动缩放,在客户端完成!
javascript 图片缩放工具(1)wordpress 圖片寬度(1)WordPress (2)jquery图片缩放(1)css图片缩放(2)php 图片缩放(17)wordpress 自动缩放图片 插件(1)wordpress 图片缩放(6)linux php 图形缩放(1)php图片缩放(8)css 图片缩放(2)ZendFramework 图片缩放(1)php 缩放 图片 处理 库(1)wordpress图片自动缩放插件(1)php缩放图片大小(1)

Share in Google Reader Share in Google Reader 分享到 FriendFeed 分享到 FriendFeed 推荐到豆瓣 推荐到豆瓣 分享到 Twitter 分享到 Twitter

One Comment

  1. 好像在IE6下都无效。

    Posted on 16-Jan-09 at 6:13 pm | Permalink

Post a Comment

Your email is never published nor shared. Required fields are marked *
*
*