Tile opacity patch from tschaub: Fix for #235. Also includes tests to ensure

that code works.


git-svn-id: http://svn.openlayers.org/trunk/openlayers@1433 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2006-09-11 14:30:25 +00:00
parent 720c8507f7
commit 4a65590d3e
4 changed files with 53 additions and 0 deletions

View File

@@ -125,6 +125,19 @@ OpenLayers.Util.createImage = function(id, px, sz, imgURL, position, border,
return image;
};
/**
* Set the opacity of a DOM Element
* Note that for this function to work in IE, elements must "have layout"
* according to:
* http://msdn.microsoft.com/workshop/author/dhtml/reference/properties/haslayout.asp
*
* @param {DOMElement} element Set the opacity on this DOM element
* @param {Float} opacity Opacity value (0.0 - 1.0)
*/
OpenLayers.Util.setOpacity = function(element, opacity) {
element.style.opacity = opacity;
element.style.filter = 'alpha(opacity=' + (opacity * 100) + ')';
}
OpenLayers.Util.onImageLoad = function() {
this.style.backgroundColor = null;