javascriptjqueryslidetoggle

slideToggle expands too far/jumps back


If you click the SERVICES link under the logo the menu will expand a little too far and then in one quick flash, it cuts back to the desired height. Any way to cure this bug?

$(document).ready(function() {
  $("li#service-toggle-link").click(function () {
    $(".toggle-content").slideToggle("slow");
  });
});

Solution

  • Your <nav id="site-navigation"> seems to have an unnecessary display: table. Try removing it and everything should work fine.

    Tables are not meant to be animated with jQuery, you can read more here: https://stackoverflow.com/a/920480/1446845