kemayo / maphilight

jQuery plugin that adds highlighting to image maps
http://davidlynch.org/projects/maphilight/docs/
MIT License
491 stars 278 forks source link

The .bind event list shouldn't contain commas #77

Closed matt-hoskins closed 6 years ago

matt-hoskins commented 7 years ago

The separator to use when specifying multiple events to jquery's ".bind" is a space - not a comma. If you include a comma it's interpreted as part of the event name (and if your event has a namespace specified then it's interpreted as being part of the namespace for the event).

This line: .bind('mouseover.maphilight, focus.maphilight', function(e) { Should read: .bind('mouseover.maphilight focus.maphilight', function(e) {

This line: }).bind('mouseout.maphilight, blur.maphilight', function(e) { clear_canvas(canvas); }); Should read: }).bind('mouseout.maphilight blur.maphilight', function(e) { clear_canvas(canvas); });

The presence of the comma means the mouseover and mouseout events are bound with the namespace "maphilight," instead of "maphilight" as it should be. This bug means e.g. calling trigger against areas with event "mouseover.maphilight" doesn't work at present.