Javascript – How to fix the flickering that occurs when you use slideToggle in jQuery


I have a simple unordered list that I want to show and hide on click using the jQuery slideUp and slideDown effect. Everything seems to work fine, however in IE6 the list will slide up, flicker for a split second, and then disappear.

Does anyone know of a fix for this?


Best Answer

Apologies for the extra comment (I can't upvote or comment on Pavel's answer), but adding a DOCTYPE fixed this issue for me, and the slideUp/Down/Toggle effects now work correctly in IE7.

See A List Apart for more information on DOCTYPES, or you can try specifying the fairly lenient 4/Transitional:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"