CSS实现图片按比例缩放

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


/*<img src="url" class="image" />*/
posted @ 2011-11-12 14:27  pangyujie  阅读(1572)  评论(0编辑  收藏  举报