3 <script src="../../lib/OpenLayers.js"></script>
4 <script type="text/javascript">
6 function test_Popup_Anchored_setOpacity(t) {
12 var sz = new OpenLayers.Size(w,h);
15 var ll = new OpenLayers.LonLat(lon, lat);
20 var map = new OpenLayers.Map('map');
21 map.addLayer(new OpenLayers.Layer('name', {'isBaseLayer':true}));
22 map.zoomToMaxExtent();
24 var popup = new OpenLayers.Popup.AnchoredBubble(id,
32 popup.setOpacity(opacity);
33 popup.draw(new OpenLayers.Pixel(x, y));
35 if (navigator.appName.indexOf("Microsoft") == -1) {
36 t.eq(parseFloat(popup.div.style.opacity), opacity, "good default popup.opacity");
38 t.eq(popup.div.style.filter, "alpha(opacity=" + opacity*100 + ")", "good default popup.opacity");
41 t.ok(popup.groupDiv!=null, "popup.groupDiv exists");
42 t.ok(popup.groupDiv.parentNode!=null, "popup.groupDiv.parentNode exists");
43 t.ok(popup.groupDiv.parentNode.getElementsByTagName("span").length > 0, "popup.groupDiv.parentNode has SPAN children");
45 var ricoCornerDiv = popup.groupDiv.parentNode.getElementsByTagName("span")[0];
46 if (navigator.appName.indexOf("Microsoft") == -1) {
47 t.eq(parseFloat(ricoCornerDiv.style.opacity), opacity, "good default ricoCornerDiv.opacity");
49 t.eq(ricoCornerDiv.style.filter, "alpha(opacity=" + opacity*100 + ")", "good default ricoCornerDiv.opacity");
57 <div id="map" style="width:512px; height:256px"> </div>