Bug Tracker

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#10760 closed bug (invalid)

jQuery Selector for UI Tab Click Event

Reported by: [email protected] Owned by: [email protected]
Priority: undecided Milestone: None
Component: unfiled Version: 1.7
Keywords: Cc:
Blocked by: Blocking:

Description

I'm not sure if this is a core jQuery issue or one of jQuery UI Tabs, but in IE8 with jQuery 1.7 and jQuery 1.8.16 if you try to bind to the click event of a tab as follows:

$('#jQueryTabs ul li a').live('click', function () {}); $(document).on('click', '#jQueryTabs ul li a', function () {});

Nothing will happen when you click on any of the tabs. However, if you change the syntax to be as follows it will work as expected:

$('#jQueryTabs ul li a').click(function () {});

I was under the impression that the .live() and .on() events would cover all of these scenarios?

Thanks!

Change History (6)

comment:1 Changed 10 years ago by dmethvin

Thanks for taking the time to contribute to the jQuery project! Please provide a complete reduced test case on jsFiddle to help us assess your ticket.

Additionally, be sure to test against the jQuery Edge version to ensure the issue still exists. To get you started, use this boilerplate: http://jsfiddle.net/FrKyN/ Open the link and click to "Fork" (in the top menu) to get started.

comment:2 Changed 10 years ago by dmethvin

Owner: set to [email protected]
Status: newpending

comment:3 Changed 10 years ago by [email protected]

Status: pendingnew

Hello dmethvin,

Sorry for the delay, I've added a simple test case to JSFiddle here:

http://jsfiddle.net/FrKyN/132/

I've added the .click event (which works) in the middle of the .live and .on declarations, if you click a tab you'll notice that only the .click event fires.

Cheers!

comment:4 Changed 10 years ago by [email protected]

Apologies I missed a closing </html> tag in the example, this is fixed in:

http://jsfiddle.net/FrKyN/134/

Cheers!

comment:5 Changed 10 years ago by dmethvin

Resolution: invalid
Status: newclosed

comment:6 Changed 10 years ago by [email protected]

Hello,

Could you please explain why this was closed, and if this was invalid what I had been doing wrong?

Regards

Note: See TracTickets for help on using tickets.