<div style="line-height:1.7;color:#000000;font-size:14px;font-family:arial"><DIV>Dear all.</DIV>
<DIV>I generated the code as below.</DIV>
<DIV>.Actually,the marker doesn't response to mousedown.</DIV>
<DIV>But it works well if I remove this -------marker.icon = icon</DIV>
<DIV>My question is How to change marker icons?</DIV>
<DIV> </DIV>
<DIV>Thanks in advance.</DIV>
<DIV> </DIV>
<DIV>function addMarker() {</DIV>
<DIV> var layer, markers;</DIV>
<DIV> var currentPopup;</DIV>
<DIV> markers = new OpenLayers.Layer.Markers("Markers");<BR> map.addLayer(markers);<BR> var size = new OpenLayers.Size(20, 20);<BR> var offset = new OpenLayers.Pixel(-(size.w / 2), -size.h);</DIV>
<DIV> var icon = new OpenLayers.Icon('http://www.openlayers.org/dev/img/marker.png', size, offset);<BR> </DIV>
<DIV> AutoSizeFramedCloud = OpenLayers.Class(OpenLayers.Popup.FramedCloud, {<BR> 'autoSize' : true</DIV>
<DIV> });<BR> popupClass = AutoSizeFramedCloud;<BR> popupContentHTML = '<img src="<A href="http://www.openlayers.org/dev/img/marker.png"></img>'">http://www.openlayers.org/dev/img/marker.png"></img>'</A></DIV>
<DIV> var feature = new OpenLayers.Feature(markers, new OpenLayers.LonLat(503810,4307378));<BR> feature.closeBox = true;<BR> feature.popupClass = popupClass;<BR> feature.data.popupContentHTML = popupContentHTML;<BR> feature.data.overflow = (true) ? "auto" : "hidden";</DIV>
<DIV> var marker = feature.createMarker();<BR> marker.icon = icon</DIV>
<DIV> var markerClick = function(evt) {<BR> if (this.popup == null) {<BR> this.popup = this.createPopup(this.closeBox);<BR> map.addPopup(this.popup);<BR> this.popup.show();<BR> } else {<BR> this.popup.toggle();<BR> }<BR> currentPopup = this.popup;<BR> OpenLayers.Event.stop(evt);<BR> };<BR> marker.events.register("mousedown", feature, markerClick);</DIV>
<DIV> markers.addMarker(marker);</DIV>
<DIV>}</DIV></div><br><br><span title="neteasefooter"><span id="netease_mail_footer"></span></span>