Side navigation
#5461 closed bug (duplicate)
Opened November 06, 2009 06:57AM UTC
Closed November 06, 2009 02:34PM UTC
Live Click Event Triggers on Right- and Middle-Click
Reported by: | Wardrop | Owned by: | brandon |
---|---|---|---|
Priority: | major | Milestone: | 1.4 |
Component: | event | Version: | 1.3.2 |
Keywords: | click event, middle-click, right-click | Cc: | |
Blocked by: | Blocking: |
Description
If you are to compare the following code...
$('#clicker').click(function () { alert('Clicked') });
...with this...
$('#clicker').live('click', function () { alert('Clicked') });
...you will find that right- or middle-clicking on the second example, will trigger the event (show the alert box in this case). The first, non-live, click event however, only triggers on a left-click as expected.'
I'm currently trying to make an image gallery which allows users to middle-click if they wish to open the selected image in another tab, however, if using the live() function for the click event, middle-click does not work, and instead triggers the click event.
This behaviour can be observed in the demonstrations on the relative jQuery documentation pages.
By the way, this happens in both IE8 and Firefox (the only two browser I've tested this in).