日期:2014-05-16 浏览次数:20499 次
Ext.getCmp('img_viewer_box').getEl().dom.src = imgurl;
var imageWin; ///显示指定url的图片 function ShowImg(imgurl,imgtitle) { //Ext.Msg.alert('Status',imgurl); if(!imageWin) { imageWin = new Ext.Window({ title: imgtitle+' - '+imgurl, src: imgurl, height:400, width:536, //bodyStyle:'background-image:url('+imgurl+');background-repeat:no-repeat; background-attachment:scroll;', plain:false, maxinizable:true, closeAction:'hide',//"close"释放窗体所占内存,"hide"隐藏窗体 closable:true, autoDestroy:true, layout:'fit', items:[{ xtype: 'box', //或xtype: 'component', id:'img_viewer_box', autoEl: { tag: 'img', //指定为img标签 src: imgurl //指定url路径 } }] }); } else { Ext.getCmp('img_viewer_box').getEl().dom.src = imgurl; imageWin.setTitle(imgtitle+' - '+imgurl); } if(imageWin.isHidden()) { imageWin.show(); } }