diff --git a/lib/OpenLayers/Control/PanZoomBar.js b/lib/OpenLayers/Control/PanZoomBar.js index 2d4635f98c..0c220a2c84 100644 --- a/lib/OpenLayers/Control/PanZoomBar.js +++ b/lib/OpenLayers/Control/PanZoomBar.js @@ -52,10 +52,12 @@ OpenLayers.Control.PanZoomBar.prototype = var imgLocation = OpenLayers.Util.getImagesLocation(); var zoomStopSize = this.zoomStopHeight; - var slider = OpenLayers.Util.createAlphaImageDiv(imgLocation+"slider.png", + var id = "OpenLayers_Control_PanZoomBar_Slider" + this.map.id; + var slider = OpenLayers.Util.createAlphaImageDiv(id, + centered.add(-1, (this.map.getZoomLevels())*zoomStopSize), new OpenLayers.Size(20,9), - centered.add(-1, (this.map.getZoomLevels())*zoomStopSize), "absolute", - "OpenLayers_Control_PanZoomBar_Slider" + this.map.id); + imgLocation+"slider.png", + "absolute"); slider.style.zIndex = this.div.zIndex + 5; this.slider = slider; @@ -68,10 +70,13 @@ OpenLayers.Control.PanZoomBar.prototype = sz.h = zoomStopSize*(this.map.getZoomLevels()+1); sz.w = this.zoomStopWidth; 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" + this.map.id); + + if (OpenLayers.Util.alphaHack()) { + var id = "OpenLayers_Control_PanZoomBar" + this.map.id; + div = OpenLayers.Util.createAlphaImageDiv(id, centered, + new OpenLayers.Size(sz.w, zoomStopSize), + imgLocation + "zoombar.png", + "absolute"); div.style.height = sz.h; } else { div = OpenLayers.Util.createDiv( @@ -80,6 +85,7 @@ OpenLayers.Control.PanZoomBar.prototype = sz, imgLocation+"zoombar.png"); } + this.divEvents = new OpenLayers.Events(this, div); this.divEvents.register("mousedown", this, this.divClick); this.divEvents.register("mousemove", this, this.zoomBarDivDrag);