Is it possible to handle such events as:
If it is possible, please give a code example for it.
bind() method is used for attaching an event handler directly to elements. Handlers are attached to the currently selected elements in the jQuery object, so those elements must exist at the point the call to . bind() occurs.
A handler is something that is done when an event occurs. Like when you click a button, what occurs because the button was clicked is the handler. It handles the given event. Here is a list of events that will have handlers for jquery.
You can do something like this (jQuery for the click handler, but any framework works on the part that matters):
$(selector).click(function(e) { if(e.shiftKey) { //Shift-Click } if(e.ctrlKey) { //Ctrl+Click } if(e.altKey) { //Alt+Click } });
Just handle whichever you want inside an if
inside the click handler like I have above.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With