source: extensions/rv_gmaps/trunk/template/windows_13/themes/iefix/iepngfix.htc @ 3447

Last change on this file since 3447 was 3447, checked in by rvelices, 15 years ago
  • added RV Map & Earth extension
File size: 1.6 KB
Line 
1<public:component>
2<public:attach event="onpropertychange" onevent="doFix()" />
3
4<script type="text/javascript">
5
6// IE5.5+ PNG Alpha Fix v1.0RC4
7// (c) 2004-2005 Angus Turnbull http://www.twinhelix.com
8
9// This is licensed under the CC-GNU LGPL, version 2.1 or later.
10// For details, see: http://creativecommons.org/licenses/LGPL/2.1/
11
12// Modified/Simplified on 04/23/2007 by Sebastien Gruhier (http://www.xilinus.com)
13// To work only on background and to handle repeat bg 
14                     
15// This must be a path to a blank image. That's all the configuration you need.
16if (typeof blankImg == 'undefined') var blankImg = 'blank.gif';
17
18var f = 'DXImageTransform.Microsoft.AlphaImageLoader';
19
20function filt(s, m)
21{
22 if (filters[f])
23 {
24  filters[f].enabled = s ? true : false;
25  if (s) with (filters[f]) { src = s; sizingMethod = m }
26 }
27 else if (s) style.filter = 'progid:'+f+'(src="'+s+'",sizingMethod="'+m+'")';
28}
29
30function doFix()
31{         
32 // Assume IE7 is OK.
33 if (!/MSIE (5\.5|6\.)/.test(navigator.userAgent) ||
34  (event && !/(background|src)/.test(event.propertyName))) return;
35
36 var bgImg = currentStyle.backgroundImage || style.backgroundImage; 
37 var bgRepeat = currentStyle.backgroundRepeat || style.backgroundRepeat;       
38 if (bgImg && bgImg != 'none')
39 {
40  if (bgImg.match(/^url[("']+(.*\.png)[)"']+$/i))
41  {
42   var s = RegExp.$1;
43   if (currentStyle.width == 'auto' && currentStyle.height == 'auto')
44    style.width = offsetWidth + 'px';
45   style.backgroundImage = 'none';
46   filt(s, bgRepeat == "no-repeat" ? 'crop' : 'scale');
47  }
48 }
49}
50
51doFix();
52
53</script>
54</public:component>
Note: See TracBrowser for help on using the repository browser.