Changeset 254 for dev/style

Show
Ignore:
Timestamp:
12/05/07 20:53:40 (15 years ago)
Author:
exi
Message:

Merging 242:253 branch into dev

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • dev/style/generic.js

    r196 r254  
    7070} 
    7171//--> 
     72 
     73/* 
     74  
     75Correctly handle PNG transparency in Win IE 5.5 & 6. 
     76http://homepage.ntlworld.com/bobosola. Updated 18-Jan-2006. 
     77 
     78Use in <HEAD> with DEFER keyword wrapped in conditional comments: 
     79<!--[if lt IE 7]> 
     80<script defer type="text/javascript" src="pngfix.js"></script> 
     81<![endif]--> 
     82 
     83*/ 
     84 
     85var arVersion = navigator.appVersion.split("MSIE") 
     86var version = parseFloat(arVersion[1]) 
     87 
     88if ((version >= 5.5) && (document.body.filters))  
     89{ 
     90   for(var i=0; i<document.images.length; i++) 
     91   { 
     92      var img = document.images[i] 
     93      var imgName = img.src.toUpperCase() 
     94      if (imgName.substring(imgName.length-3, imgName.length) == "PNG") 
     95      { 
     96         var imgID = (img.id) ? "id='" + img.id + "' " : "" 
     97         var imgClass = (img.className) ? "class='" + img.className + "' " : "" 
     98         var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' " 
     99         var imgStyle = "display:inline-block;" + img.style.cssText  
     100         if (img.align == "left") imgStyle = "float:left;" + imgStyle 
     101         if (img.align == "right") imgStyle = "float:right;" + imgStyle 
     102         if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle 
     103         var strNewHTML = "<span " + imgID + imgClass + imgTitle 
     104         + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";" 
     105         + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader" 
     106         + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>"  
     107         img.outerHTML = strNewHTML 
     108         i = i-1 
     109      } 
     110   } 
     111}