Hi,
I want to trigger an event on an element list. The list may have multiple selection. The event should be triggered directly, if user clicks on element without ctrl key.
If the user presses ctrl+click then, event should be triggered once the selection is done.
I have written my own logic for that here.
I can prevent event from triggering immediately after click with combination of ctrl. But I am not getting the idea when to trigger my own function(lets say alert here…) ,if there is multiple selection.
DEMO
Note
you don’t need to maintain any flag for
ctrlkey press.event.ctrlKeywill do this for you.