You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Will create two event handlers for keydown on document.
This could be improved by creating just one event handler for keydown, and eveytime a new key is registered, jQuery's data facilities could be used to store the information about which keys should be handled.
This would also facilitate de-registering an event handler for a specific key (just remove the data information about that key)
The text was updated successfully, but these errors were encountered:
ruidfigueiredo
changed the title
A new event handler is created every time a handler is registered for a key
Don't create a new event handler is created every time a handler is registered for a key
Mar 11, 2016
ruidfigueiredo
changed the title
Don't create a new event handler is created every time a handler is registered for a key
Don't create a new event handler every time a handler is registered for a key
Mar 11, 2016
This statement:
$(document)
.onLeftArrowKeyDown(previousPage)
.onRightArrowKeyDown(nextPage);
Will create two event handlers for keydown on document.
This could be improved by creating just one event handler for keydown, and eveytime a new key is registered, jQuery's data facilities could be used to store the information about which keys should be handled.
This would also facilitate de-registering an event handler for a specific key (just remove the data information about that key)
The text was updated successfully, but these errors were encountered: