Hi,
  I'm binding an event with oneclick and it's working just fine in firefox,
but the contents of the code actually fires itself in IE like an .each
instead of binding it to the click event.

Here's the context: I've got a page that will list an address, with a little
add/remove button.  When the button is on the add state, it will add a
marker to a google map and bind the remove marker command to it on a click
(then change the state to "remove".

In IE, when the add button is clicked, it will add the marker to the map and
immediately remove it.

Here's the code in question:

function removeMarkerOnClick(marker, element, map) {
  // Use the default map if no map is passed
  map = map || default_map;
  // make the $(action_map).click() do overlay removal [it's usually passed
a marker, but should be able to accomidate other overlay types]
  $(element).oneclick(function() {
    alert("I am removing this marker!");
    map.removeOverlay(marker);
  });
};


it's called by:

  var locinfo = new LocationInfo(latitude, longitude, firm_name,
$(display).html());

  if ($(this).attr("action") == "add") {
    $(this).attr("action", "delete");
    $(this).children("img").src("icons/world_delete.png");
    // Add this address to the map
    var marker= add_to_map(locinfo);
    // Allow this marker to be removed
    removeMarkerOnClick(marker, map_button);
  } else {
    $(this).attr("action", "add");
    $(this).children("img").src("icons/world_add.png");
  }     


I didn't see this filed as a bug report in Trac.  I'm using the latest
official release (1.0.4).  Is this a known issue?  Do people already have
workarounds?

Thanks!
-- 
View this message in context: 
http://www.nabble.com/oneclick-working-in-Firefox-but-not-IE-tf2845547.html#a7946023
Sent from the JQuery mailing list archive at Nabble.com.


_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to