javascript - Yandex maps api - event handler executed only once -
i achieve similar .one()
/ http://api.jquery.com/one/ myyandexmap.events.add('click', function(e){})
. means, have function on click, run once or replace other function.
i have tried remove inner function @ end of function, didn't figure out how it. i've done
yxmap.events.add('click', function (e){ add_wp_map_click(e, num, color) }); function add_wp_map_click(e, num, color){ ... yxmap.events.remove('click', function (e){ add_wp_map_click(e, num, color) }); }
you can try use .once
method as:
yxmap.events.once('click', handler, context);
Comments
Post a Comment