帝国CMS程序安装头像裁切插件,帝国CMS怎么实现头像裁切功能
2014-01-22 10:26:01

                 
               }
               else
               {
                if(img_height>=400)
                {
                 show_width=img_width*400/img_height;
                 margin_height=0;
                }
                else
                {
                 show_width=img_width;
                 margin_height=(400-img_height)/2;
                }
                 $("#tb").children().remove();
                 $("#tb").append("<div style="width:400px; height:400px; border:solid 2px #ddd; text-align:center;"><img src=""+img_src+"" id="target"  width=""+show_width+"px" /></div><div style="width:100px;height:100px;overflow:hidden;"><img src=""+img_src+"" id="preview" width="100px" alt="Preview" />")