Page jump when changing height

Page jump when changing height

Hello,

I'm having a page jump problem.  On button click, I'm adding a class to a ul, which changes the layout of it's contents and makes the ul taller.  This makes the page height taller, and as far as I can tell is what is causing the page jump when I click the button.   It does not cause a page jump if I set a massive height on the ul.  This is not practical though, because the content is dynamic and having a ton of whitespace on the bottom isn't very classy.  

The concept is very similar to what this guy's doing (he has page jump problem too):

My JS is:
  1. $('#listview').click(function () {
  2. $("ul.display").fadeOut("fast").addClass("listview").stop(true, true).fadeIn("fast");
  3. return false;
  4. });
  5. $('#gridview').click(function () {
  6. $("ul.display").fadeOut("fast").removeClass("listview").stop(true, true).fadeIn("fast");
  7. return false;
  8. });
Does anyone know how to get the height of ul.listview  when it hasn't been added yet?  Or some other workaround to the page jump / height problem?
    • Topic Participants

    • ryan