Ok, I was wrong, it is working. I happened to be on a page where there
was another error having to do with the Superfish declaration that was
causing problems. Still working on that other issue with jQuery
conflicting with LightWindow (Joel has already responded to that
post).
As a side note, I d
I tried this and it did not give any of the li's a z-index. I even
placed the function inside the document.ready function. Here is what I
changed the function to read as:
jQuery('ul.sf-menu li').each(function(i){
jQuery(this).css('z-index',30-i);
});
I did also try using '#sf-menu li' (ye
Great stuff Ricardo! Thanks for doing this.
Just a small warning: you said "which equals the element's index in
relation to its parent". Whilst this probably does work in most cases,
be aware that (as far as I know) DOM elements are not guaranteed to be
returned in the order they appear in the so
It's quite simple, the each() function already passes a variable to
the inner function, which equals the element's index in relation to is
parent.
--> this is index 0
--> index 1
--> 2 etc
What my code does is iterate over all the elements and for each
one, give it the inline css
Two questions?
Wouldn't I have to still pass a value for i for each instantiation of
an li? Or do I not quite understand how this works? Basically could
you explain how this works a little bit so that I fully understand the
jQuery and JS behind it. I would really appreciate that.
The other quest
or better yet (thanks Eric!):
$('#menu li').each(function(i){
$(this).css('z-index',10-i);
});
- ricardo
On Sep 23, 3:06 pm, ricardobeat <[EMAIL PROTECTED]> wrote:
> $('#menu li').each(function(){
> var zindex = 10 - $(this).parent().find('li').index(this);
> $(this).css('z-index',zindex)
$('#menu li').each(function(){
var zindex = 10 - $(this).parent().find('li').index(this);
$(this).css('z-index',zindex);
});
On Sep 23, 10:12 am, Aaron <[EMAIL PROTECTED]> wrote:
> Unfortunately I don't understand the jQuery enough to put something
> like that together. Anyone else understand i
Unfortunately I don't understand the jQuery enough to put something
like that together. Anyone else understand it enough to give this a
whirl?
Aaron
On Sep 22, 9:55 pm, "Joel Birch" <[EMAIL PROTECTED]> wrote:
> Your solution for fixing this incarnation of the IE z-index bug is
> actually the onl
Your solution for fixing this incarnation of the IE z-index bug is
actually the only one I have ever come across, so whilst it is hacky,
it's probably as good as you are going to get. I guess a nifty bit of
jQuery could make applying the z-indexes easier and keep the source
HTML clean. If anyone w
9 matches
Mail list logo