From 5f4a8d2b0d99216322d9509009649601cbda4b61 Mon Sep 17 00:00:00 2001 From: crschmidt Date: Thu, 25 May 2006 19:46:49 +0000 Subject: [PATCH] Make a first attempt at making the zoombar div transparency work in IE. Since this image is a background image, I want to be able to set different sizes for the img and the div. I'm nt sure how well this attempt will work. However, the code still works in FF on OS X. Someone with IE test when they get a bit? git-svn-id: http://svn.openlayers.org/trunk/openlayers@374 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Control/PanZoomBar.js | 19 ++++++++++++------- lib/OpenLayers/Util.js | 4 ++-- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/lib/OpenLayers/Control/PanZoomBar.js b/lib/OpenLayers/Control/PanZoomBar.js index 6d20b3459d..2c11105b3e 100644 --- a/lib/OpenLayers/Control/PanZoomBar.js +++ b/lib/OpenLayers/Control/PanZoomBar.js @@ -67,13 +67,18 @@ OpenLayers.Control.PanZoomBar.prototype = sz.h = zoomStopSize*(this.map.getZoomLevels()+1); sz.w = this.zoomStopWidth; - - var div = OpenLayers.Util.createDiv( - 'OpenLayers_Control_PanZoomBar_Zoombar' + this.map.id, - centered, - sz); - div.style.backgroundImage = "url("+imgLocation+"zoombar.png)"; - + var div = null + if ((document.body.filters && (version >= 5.5) && (version < 7))) { + div = OpenLayers.Util.createAlphaImageDiv(imgLocation+"zoombar.png", + new OpenLayers.Size(sz.w, zoomStopSize), + centered, "absolute", "OpenLayers_Control_PanZoomBar_Slider" + this.map.id, sz); + } else { + div = OpenLayers.Util.createDiv( + 'OpenLayers_Control_PanZoomBar_Zoombar' + this.map.id, + centered, + sz); + div.style.backgroundImage = "url("+imgLocation+"zoombar.png)"; + } this.divEvents = new OpenLayers.Events(this, div); this.divEvents.register("mousedown", this, this.divClick); this.divEvents.register("mousemove", this, this.zoomBarDivDrag); diff --git a/lib/OpenLayers/Util.js b/lib/OpenLayers/Util.js index 949e05b227..582daa253c 100644 --- a/lib/OpenLayers/Util.js +++ b/lib/OpenLayers/Util.js @@ -683,9 +683,9 @@ OpenLayers.Util.createImage = function(img, sz, xy, position, id, border) { * @type DOMElement */ OpenLayers.Util.createAlphaImageDiv = function(imgURL, sz, px, position, - id, border) { + id, border, divSz) { - var div = OpenLayers.Util.createDiv(id, px, sz); + var div = OpenLayers.Util.createDiv(id, px, (divSz ? divSz : sz)); var img = OpenLayers.Util.createImage(imgURL, sz, null, "relative", id + "_innerImage", border); div.appendChild(img);