Skip to content

图片缩放是个头疼的问题

转载本站文章请注明:
转载来至:[记录与PHP的PK经历]
本文链接: 图片缩放是个头疼的问题

最近自己再做项目,其中图片处理是一大块,把图片缩放到几种格式的大小,但是到了应用却发现总是不够用,没办法只能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)jquery图片缩放(2)css图片缩放(1)php 图片缩放(3)wordpress图片缩放(1)php图片缩放(5)php图片(1)wordpress 图片自动缩放(1)jquery 图片缩放(1)php 缩放图片(1)ajax 图片缩放(1)

中文关键字:css auto google 图片 自动 image 头疼 问题 width elm 方法 height 宽度 700 560

Post a Comment

Your email is never published nor shared. Required fields are marked *
*
*
Note: Commenter is allowed to use '@User+blank' to automatically notify your reply to other commenter. e.g, if ABC is one of commenter of this post, then write '@ABC '(exclude ') will automatically send your comment to ABC. Using '@all ' to notify all previous commenters. Be sure that the value of User should exactly match with commenter's name (case sensitive).