views:

165

answers:

1

Basically I have something like this:

<ul>
<li>
<a>
<div class="trigger-layer"></div>
<div class="title-layer">Text here</div>
<div class="hover-layer"></div>
</a>
</li>
</ul>

I use jQuery to animate the <ul> as follow:

$ul = xxx (where I assign the selector to var $ul)
$ul.animate({opacity: 0}, 1000, function() {$ul.css("display", "none")});

However in IE8, as the <ul> fades off, the <div class="title-layer">Text here</div> remains clear and opaque. Finally the animation ends, the display: none; property is applied onto the <ul> and the text disappears aburptly.

+1  A: 

You have some external markup/styling/script going on here affecting this, using only what you posted works, you can see a demo here: http://jsfiddle.net/r7pwQ/

Are you sure there's no invalid HTML going on? (besides the <div>s inside the anchor, which is invalid as well :) Make sure you're dealing with valid HTML, otherwise IE will do all sorts of random things.

Nick Craver
But there is no other way I can accomplish what I need within the scope of my technical expertise as of now :(
Fabian
You can see an example here: http://jsfiddle.net/VHNvh/ animation is slowed to 5000ms so I can see exactly what's going on.
Fabian
@Fabian - There are a *lot* of extra divs there...may I ask why you're trying to write a menu anyway? (The problem is the relative position on the title div, though there are complicating factors with all your z-indexes). There are existing menus that do what you're after, e.g. [superfish for the style you have](http://users.tpg.com.au/j_birch/plugins/superfish/)
Nick Craver
So `position: relative;` is what causes the problem with IE 8? For the record IE 7 renders the font really weird, like it's blotchy and pixelated. Well that menu is generated by Wordpress's native `wp_list_pages()` function, so I have limited control over the tags used. Inserting `<div>` into the anchor tag is the only way I can come up with.
Fabian