開發 freetextbox 遇到的問題---急急!!!! 目前網上流行的freetextbox 在插入圖片後,圖片大小可以通過移mouse來改變width,height,現在我想做,在移動圖片width,height時能實現等比縮放。這個功能如何實現。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 用js可以实现, freetextbox 就不知道能不能实现了。不能的花你需要自己修改代码。 我记得好想见过类似的方法,有人的blog里有,但是实在忘了是那里见的了. 1.大小图片通吃function DownImage(ImgD){ var image=new Image(); image.src=../../ImgD.src; if(image.width>0 && image.height>0){ //flag=true; if(image.width>=300){ ImgD.width=300; ImgD.height=(image.height*300)/image.width; }else{ ImgD.width=image.width; ImgD.height=image.height; } } } 图片如果宽度不大于300,原始大小显示,否则缩放大小。2.真对大图片<script language="javascript"> //图片处理函数 function changeImageSize(img) { if(img.height > 90 || img.width > 90){ if(img.height >= img.width){ img.height=90; } else { img.width=90; } } }</script>http://topic.csdn.net/t/20051026/09/4350582.htmlhttp://www.chinaccna.com/www/aspnet/200605/13779.html 类库无法使用WebConfigurationManager吗?怎样解决? .net两页面实例化的问题! Jquery Ztree 插件 这么判断值是否改变? GridView里的控件获取DataKeys 关于HTML编码的问题 asp.net2.0中怎么调用梅花雨日历啊?急~在线等 一简单文本读写问题! asp.net(c#)中如何清除所有COOKIES? 如何设置二维COOKIE数组? 简单问题,在线等! 怎么做网上电子邮件收发和查看删除呢? .net中這樣的字符串如何截取?up有分 大家来看看,删除XML节点时候出来的奇怪问题.
不能的花你需要自己修改代码。
var image=new Image();
image.src=../../ImgD.src;
if(image.width>0 && image.height>0){
//flag=true;
if(image.width>=300){
ImgD.width=300;
ImgD.height=(image.height*300)/image.width;
}else{
ImgD.width=image.width;
ImgD.height=image.height;
}
}
}
图片如果宽度不大于300,原始大小显示,否则缩放大小。
2.真对大图片<script language="javascript">
//图片处理函数
function changeImageSize(img) {
if(img.height > 90 || img.width > 90){
if(img.height >= img.width){
img.height=90;
} else {
img.width=90;
}
}
}
</script>
http://topic.csdn.net/t/20051026/09/4350582.html
http://www.chinaccna.com/www/aspnet/200605/13779.html