jQuery hide/show div working in Opera and Chrome but not IE/Firefox
Posted
by injekt
on Stack Overflow
See other posts from Stack Overflow
or by injekt
Published on 2010-03-08T18:10:23Z
Indexed on
2010/03/08
18:21 UTC
Read the original article
Hit count: 305
Hey guys, the following snippet of jQuery code seems to work fine in Google Chrome and Opera, but nothing happens when I try hiding/showing the related div in Internet Explorer or Firefox. Any ideas?
$(function() {
$(".paste-meta-small .right a.collapse").click(function(event) {
$(this).parents(".paste-meta-small").next(".highlight").toggle(500);
$(this).text($(this).text() == 'show' ? 'hide' : 'show');
event.preventDefault();
})
})
$(function() {
$(".highlight-meta a.blog-collapse").click(function(event) {
$(this).parents(".highlight-meta").next(".blog-highlight").toggle(500);
$(this).text($(this).text() == 'show' ? 'hide' : 'show');
var margin = ($(this).text() == "show" ? "15px" : "0");
$(this).parents(".highlight-meta").css("margin-bottom", margin);
event.preventDefault();
})
})
A working example can be found here
Thanks in advance
© Stack Overflow or respective owner