I have done some additional testing and I think this might be a jQuery
bug which was introduced at v1.2.5. jQuery v1.2.4 was not released and
the script works in all browsers up to jQuery 1.2.3. But one of my
other scripts only works in jQuery 1.2.6, so I need that version.

On Thu, Dec 18, 2008 at 2:01 PM, DasJan <jro...@gmail.com> wrote:
> 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
>
>
>

Reply via email to