Animating a containing <div> using jQuery .animate doesn't work in IE
htmLayer1
), which contains two other divs (htmLayer1tab
and htmLayer1pic
) using jQuery .animate
.
The following code works fine in Firefox, Safari, Chrome and Opera:
$("#htmLayer1tab").toggle(
function() {
$("#htmLayer1").animate({top: "-435px"}, 300, "swing");
},
function() {
$("#htmLayer1").animate({top: "0px"}, 300, "swing");
$("#htmLayer1tab").css("z-index", 7);
}
);
, but in IE the only thing that moves is the tab-div. The picture-div doesn't follow.
The picture is added tohtmLayer1pic
through CSS as a background-image
and the tab is achieved through an img
-tag inside 开发者_如何学JAVAhtmLayer1tab
.
Why won't IE animate both divs inside htmLayer1
, but only one of them? And what can I do to fix it?
Kind regards,
bingocallerEDIT:
I've created a more detailed fiddle here: jsFiddle Example
精彩评论