Skip to main content

Bug Tracker

Side navigation

#6112 closed bug (invalid)

Opened February 17, 2010 02:21PM UTC

Closed June 15, 2010 12:08AM UTC

Last modified March 13, 2012 11:51PM UTC

:eq() Selector not working in Chrome, Safari and Opera

Reported by: cssensei Owned by:
Priority: undecided Milestone: 1.4.2
Component: selector Version: 1.4.1
Keywords: :eq() Selector Cc:
Blocked by: Blocking:
Description

I'm curently working on a new project. I had to add some classes to may navigation system and I've used the following snippet:

jQuery(".left_nav ul.menu li:eq(7)").addClass("sub");

and all gone fine in firefox and internet explorer, but in chrome, safari and opera nothing happened.

They don't recongize this as a function. I managed to figure out that a working snippet for all browsers is a little different. Here's the working jQuery line:

jQuery(".left_nav ul.menu li").eq(7).addClass("sub");

Is this a jQuery bug?

Attachments (0)
Change History (3)

Changed June 15, 2010 12:08AM UTC by dmethvin comment:1

component: unfiledselector
resolution: → invalid
status: newclosed

Kind of hard to say without a complete test case that includes the markup. However, this type of question is best handled in the forum, rather than the bug tracker.

Changed December 14, 2010 02:57PM UTC by anonymous comment:2

I have the same problem and I think it's a bug in Opera.

<div id="someId">

<span>1</span>

<span>2</span>

<span>3</span>

</div>

This works:

$('span:eq(1)').text();

This doesn't work:

$('#someId span:eq(1)').text();

Changed December 14, 2010 10:30PM UTC by jitter comment:3

priority: → undecided

Replying to [comment:2 anonymous]:

I have the same problem and I think it's a bug in Opera. <div id="someId"><span>1</span><span>2</span><span>3</span></div> This works: $('span:eq(1)').text(); This doesn't work: $('#someId span:eq(1)').text();

test case Can't reproduce this. Both return "2"