Keyboard event left / right in jqPlot

I would like to make a hint that will respond to the keys (left / right). How to add an event in a similar way:

$.jqplot.eventListenerHooks.push(['jqplotClick', handleClick]); 

I need to get the "plot" object in the event.

+4
source share
1 answer

You might want to start by checking out one of my other answers and see the sample code. It is a way to listen for keyboard events. It comes down to the following code:

 $(document).keydown(function(e) { if (e.keyCode == 37) { //on left arrow key down } else if (e.keyCode == 39) { //on right arrow key down } }); 

Remember that for the sample response to the keys, the "Result" area on jsfiddle must be selected.

Personally, for a tooltip, I would use the usual one to better control it. How to do this, for example, is presented in this answer .

0
source

Source: https://habr.com/ru/post/1501457/


All Articles