From a97c6b9bd972a534eccb39def2f1f71b32315fd8 Mon Sep 17 00:00:00 2001 From: janw Date: Mon, 12 Dec 2005 13:23:53 +0000 Subject: [PATCH] [COSMETIC] Make even "input type='image'" pics transparent in IE. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2297 594d385d-05f5-0310-b6e9-bd551577e9d8 --- html/include/png.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/html/include/png.js b/html/include/png.js index 145eaae17..2260c2b90 100644 --- a/html/include/png.js +++ b/html/include/png.js @@ -7,9 +7,17 @@ function pngLoadPngs() var rslt = navigator.appVersion.match(/MSIE (\d+\.\d+)/, ''); var itsAllGood = (rslt != null && Number(rslt[1]) > 5.5); - if (itsAllGood) - for (var i = 0; i < document.images.length; i++) + if (itsAllGood) { + for (var i = 0; i < document.images.length; i++) { pngLoad(document.images[i]); + } + for (var i = 0; i < document.getElementsByTagName("input").length; i++) { + var img = document.getElementsByTagName("input")[i]; + if(typeof img.type == "string" && img.type == "image") { + pngLoad(img); + } + } + } } // loads an image, src is optional // public @@ -41,6 +49,10 @@ function pngLoad(img,src) // no src arameter, but its png -> simply swap pngSwapPrepare(img); } + } else if (typeof img.tagName == "string" && img.tagName == "INPUT") { + if(img.src.match(/\.png$/i) != null) { + pngSwapPrepare(img); + } } // swap (if complete) or shedule it to onload event // private -- 2.30.2