[jQuery] element:gt(0) works in FF, but not in Safari/IE/Chrome

[jQuery] element:gt(0) works in FF, but not in Safari/IE/Chrome


Hi!
I have the following code which, using jQuery 1.1.2 works in FF/Safari/
IE:
function menu_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++;
});
}
I just recently updated to jQuery 1.2.6 and the above code now only
works in FF, but not in Safari/IE/Chrome.
I have a menu which is based on unordered lists, the first <li> is the
title of the menu which is always supposed to be displayed, the other
are only to be displayed when I click on the first IE. When I try this
in Safari/IE/Chrome and click on the visible LI, nothing happens.
I also tried replacing the line with:
$(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();");
Both of those also work in FF, but again not in Safari/IE/Chrome.
Any ideas?
Thanks,
Jan