Bug Tracker

Modify

Ticket #3725 (closed bug: invalid)

Opened 4 years ago

Last modified 3 years ago

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:
Blocking: Blocked by:

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.

Change History

comment:1 Changed 4 years ago by flesler

  • Owner flesler deleted

comment:2 Changed 4 years ago by dasjan

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

comment:3 Changed 3 years ago by dmethvin

  • Status changed from new to closed
  • Resolution set to invalid

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

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.