Skip to main content

Bug Tracker

Side navigation

#3725 closed bug (invalid)

Opened December 18, 2008 02:26PM UTC

Closed June 12, 2010 03:43AM UTC

Filter expression i.e. $('li:gt(1)') broken since jQuery 1.2.5

Reported by: dasjan Owned by:
Priority: major Milestone: 1.3
Component: unfiled Version: 1.2.6
Keywords: Cc:
Blocked by: Blocking:
Description

I've been using a script which works fine with jQuery 1.1 but now had to update to jQuery 1.2.6 for a new script, now the following script doesn't work anymore:

function ndxz_expanding_loader()

{

var speed = 200;

var item_title = new Array();

var items = new Array();

var i = 0;

$("#menu ul").each(function()

{

items[i] = $("#menu ul").eq(i).children().filter(function (index) { return index > 0; });

/* v1 - hide items if not active */

if (items[i].is(".active") == false) { items[i].hide(); }

/* v2 - hide all */

items[i].hide();

apply the clicker

$(this).attr('id', 'c' + i);

$(this).children(":first").css({ cursor: 'pointer' });

$$(this).attr('onclick', "$('ul#c" + i + " li:gt(0)').toggle(" + speed + ");$('#content').hide();");

i++;

});

}

Script is also viewable here: http://dev.rocho.org/nico-jquery/nico-admin/site/js/menu.js

It works correctly in the current Firefox 3, but not in current versions of Safari, IE and Chrome.

I also tried changing the line:

$(this).attr('onclick', "$('ul#c" + i + " li:gt(0)').toggle(" + speed + ");$('#content').hide();");

to:

$(this).attr('onclick', "$('ul#c" + i + " li:not(:first-child)').toggle(" + speed + ");$('#content').hide();");

and:

$(this).attr('onclick', "$('ul#c" + i + " li').slice(1).toggle(" + speed + ");$('#content').hide();");

The above examples also don't work.

And then downgraded to 1.2.5 which has the same error, 1.2.4 was not released and in jQuery 1.2.3 the script works in all browsers.

I have put up a demo at:

http://dev.rocho.org/nico-jquery

with the version that uses jQuery 1.2.6 only works in FF 3.

If you click on one of the menu items (Arbeiten,Vita, Kontakt) they won't expand on Safari, IE.

Attachments (0)
Change History (3)

Changed January 03, 2009 01:02AM UTC by flesler comment:1

owner: flesler

Changed January 20, 2009 05:22PM UTC by dasjan comment:2

Still the same issue with jQuery 1.3 to which I just updated.

Changed June 12, 2010 03:43AM UTC by dmethvin comment:3

resolution: → invalid
status: newclosed

If this is still an issue, start a discussion on the forum to debug the code.