IE下png图形的另一种处理方法(3) // this is an attempt to set the image to itself! // pointless - leave the filter as-is, restore the blank image element.src = blankSrc; } else { // set the image to something different if (IS_PNG.test(element.src)) { // fixable PNG realSrc = element.src; element.src = blankSrc; element.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + realSrc + "',sizingMethod='scale')"; } else { // ordinary image - make sure the fix is removed if (realSrc) { realSrc = null; element.runtimeStyle.filter = ''; } } }}function beforePrint() { if (realSrc) { supported = false; element.src = realSrc; element.runtimeStyle.filter = ''; supported = true; }}function afterPrint() { if (realSrc) { var rs = realSrc; realSrc = null; element.src = rs; }}</script></public:component>注意:该种方法须指定 width, heightIE 7+就不用这些麻烦了