Toggle does not work with opacity in this way, it should be a value from 0 to 1 (because you do not load in jQuery version 1.4, which supports "switching"):
$(function() $("#show-background").click(function () { $("#content-area").animate({opacity: 'toggle'}, 'slow'); }); });
I would change the code to something like this:
$(function() { $("#show-background").click(function () { var c = $("#content-area"); o = (c.css('opacity') == 0) ? 1 : 0; c.animate({opacity: o}, 'slow'); }); });
Mottie Jan 28 '10 at 3:01
source share