/[drupal]/contributions/themes/civicspace/scripts/pngfix.js
ViewVC logotype

Contents of /contributions/themes/civicspace/scripts/pngfix.js

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.3 - (show annotations) (download) (as text)
Thu Oct 27 17:48:02 2005 UTC (4 years, 1 month ago) by occy
Branch: MAIN
CVS Tags: HEAD
Branch point for: DRUPAL-6--2
Changes since 1.2: +3 -3 lines
File MIME type: text/javascript
http://drupal.org/files/issues/pngfix-opera-patch.txt
Applied patch from Alan Evans per bug: http://drupal.org/node/34175
1 /* $Id: pngfix.js,v 1.2 2005/08/29 21:52:13 robinmonks Exp $ */
2
3 // Correctly handle PNG transparency in Win IE 5.5 or higher.
4 // http://homepage.ntlworld.com/bobosola. Updated 02-March-2004
5 // updated 2005-05-11 to test for IE
6
7 function correctPNG() {
8 if (navigator.platform == "Win32" && navigator.appName == "Microsoft Internet Explorer" && navigator.userAgent.indexOf("Opera") == -1 && window.attachEvent) {
9 for(var i=0; i<document.images.length; i++) {
10 var img = document.images[i]
11 var imgName = img.src.toUpperCase()
12 if (imgName.substring(imgName.length-3, imgName.length) == "PNG") {
13 var imgID = (img.id) ? "id='" + img.id + "' " : ""
14 var imgClass = (img.className) ? "class='" + img.className + "' " : ""
15 var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
16 var imgStyle = "display:inline-block;" + img.style.cssText
17 if (img.align == "left") imgStyle = "float:left;" + imgStyle
18 if (img.align == "right") imgStyle = "float:right;" + imgStyle
19 if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
20 var strNewHTML = "<span " + imgID + imgClass + imgTitle
21 + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
22 + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
23 + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>"
24 img.outerHTML = strNewHTML
25 i = i-1
26 }
27 }
28 }
29 }
30 if (navigator.platform == "Win32" && navigator.appName == "Microsoft Internet Explorer" && navigator.userAgent.indexOf("Opera") == -1 && window.attachEvent) {
31 window.attachEvent("onload", correctPNG);
32 }

  ViewVC Help
Powered by ViewVC 1.1.2