Reputation: 445
Im having some trouble with jQuery's slideToggle function in IE8 for some reason the DIV its opening closes immediately after its opened
heres the code im using
$("h3 a").click(function(){
id = $(this).attr("href");
$(id).slideToggle("slow");
});
and the HTML
<h3><a href="#promo-materials">Graphic and Pormotional Materials</a></h3>
<div id="promo-materials" class="center gallery">
<a href="images/portfolio/bistro.png" rel="facebox">
<img src="images/portfolio/thumbs/bistro.png" alt="" />
</a>
<a href="images/portfolio/direct-savings.png" rel="facebox">
<img src="images/portfolio/thumbs/direct-savings.png" alt="" />
</a>
</div>
Here is a link to the functional page it works in all other browsers including IE7
I forgot to post it:
I currently have it triggering Compatiblity Mode since I had to get to work today.
Upvotes: 1
Views: 3735
Reputation: 8174
Remove this style from the h3 right before the gallery
display: inline-block;
that seems to fix the problem in IE8.
Upvotes: 3
Reputation: 382756
You could try this:
$("h3 a").click(function(){
id = $(this).attr("href");
$('#' + id).slideToggle("slow");
});
Upvotes: 0
Reputation: 3893
I am betting Nick's comment about it being fired twice is the answer. I copied your code above and it works great for me in IE8.
Upvotes: 0