Bug Tracker

Opened 13 years ago

Closed 13 years ago

#5461 closed bug (duplicate)

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:


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.

Change History (2)

comment:1 Changed 13 years ago by Wardrop

By the way, this happens in both IE8 and Firefox (the only two browser I've tested this in).

comment:2 Changed 13 years ago by dmethvin

Resolution: duplicate
Status: newclosed

Duplicate of #3861.

Note: See TracTickets for help on using tickets.