Index: ssts-web/src/main/webapp/js/showUploadImagesForExtWin.js =================================================================== diff -u -r31469 -r31470 --- ssts-web/src/main/webapp/js/showUploadImagesForExtWin.js (.../showUploadImagesForExtWin.js) (revision 31469) +++ ssts-web/src/main/webapp/js/showUploadImagesForExtWin.js (.../showUploadImagesForExtWin.js) (revision 31470) @@ -58,27 +58,6 @@ Ext.get(this.img_view_id).parent = this; /*Ext.get(this.img_view_id).center(); */ new Ext.dd.DD(Ext.get(this.img_view_id), 'pic');//能够图片在容器中拖动 - }, - //放大、缩小 - zoom: function (el, offset, type) { - var width = el.getWidth(); - var height = el.getHeight(); - var nwidth = type ? (width * offset) : (width / offset); - var nheight = type ? (height * offset) : (height / offset); - try { - el.animate( - { - height: { to: nheight, from: height }, - width: { to: nwidth, from: width } - }, - null, - null, - 'backBoth', - 'motion' - ); - } catch (e) { - alert(e.message); - } } }) }); @@ -109,12 +88,12 @@ showResult('图片不存在!'); return; } - srcWidth = srcWidth * scale; - srcHeight = srcHeight * scale; var imageBrowse = top.Ext.get(currentImageId); var image = imageBrowse.dom; - image.style.width = srcWidth + 'px'; - image.style.height = srcHeight + 'px'; + var width = imageBrowse.getWidth(); + var height = imageBrowse.getHeight(); + image.style.width = width*scale + 'px'; + image.style.height = height*scale + 'px'; } }, { xtype: 'button', @@ -124,12 +103,12 @@ showResult('图片不存在!'); return; } - srcWidth = srcWidth / scale; - srcHeight = srcHeight / scale; var imageBrowse = top.Ext.get(currentImageId); var image = imageBrowse.dom; - image.style.width = srcWidth + 'px'; - image.style.height = srcHeight + 'px'; + var width = imageBrowse.getWidth(); + var height = imageBrowse.getHeight(); + image.style.width = width/scale + 'px'; + image.style.height = height/scale + 'px'; } }, { xtype: 'button',