Skip to main content

Bug Tracker

Side navigation

#10760 closed bug (invalid)

Opened November 11, 2011 12:21PM UTC

Closed November 24, 2011 08:31PM UTC

Last modified November 25, 2011 09:07AM UTC

jQuery Selector for UI Tab Click Event

Reported by: jimmy.headdon@btopenworld.com Owned by: jimmy.headdon@btopenworld.com
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!

Attachments (0)
Change History (6)

Changed November 11, 2011 01:23PM UTC by dmethvin comment:1

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.

Changed November 11, 2011 01:23PM UTC by dmethvin comment:2

owner: → jimmy.headdon@btopenworld.com
status: newpending

Changed November 24, 2011 09:21AM UTC by jimmy.headdon@btopenworld.com comment:3

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!

Changed November 24, 2011 09:27AM UTC by jimmy.headdon@btopenworld.com comment:4

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

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

Cheers!

Changed November 24, 2011 08:31PM UTC by dmethvin comment:5

resolution: → invalid
status: newclosed

Changed November 25, 2011 09:07AM UTC by jimmy.headdon@btopenworld.com comment:6

Hello,

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

Regards