SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member
    Join Date
    Jul 2006
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Deleting dom element - page jerking

    Well after several hours of browsing internet i cannot find any solution.
    Here is the problem:

    I have a page which is quite long (so there is a scrollbar). When i remove a dom element that is the last on the page, page shrinks in height (browser behaviour) but this change causes jerk because space that was taken up by the element is free.

    I need to get rid of this jerking motion somehow because IMHO it makes user somewhat disoriented.

    Thank you very much in advance.

  2. #2
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,147
    Mentioned
    190 Post(s)
    Tagged
    2 Thread(s)

    re-rendering

    Instead of changing "display" which results in the page adjusting to the new dimensions, can you change "visibility" so as to maintain the same dimensions?

  3. #3
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,696
    Mentioned
    101 Post(s)
    Tagged
    4 Thread(s)
    If you are using a framework like jquery or scriptaculous, they can help to smooth out the transition by letting you gradually change the size of the element to 0 in different ways, after which you can remove it without such a jump occuring.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  4. #4
    SitePoint Member
    Join Date
    Jul 2006
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    @Mittineague: but than you will have tons of empty areas thruout the page

    @pmw57: that was my first choice however, animations are not as smooth as they could be escpecially on IE 6 and 7.

    so far my best option is to have big padding at the end of the page, so user naturally wont be scrolling until the end and miraculously when the page isnt scrolled until the end there is no "jerking".

    thank you very much
    any other ideas...

  5. #5
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,696
    Mentioned
    101 Post(s)
    Tagged
    4 Thread(s)
    If you can provide us with a link to a sample page, we can explore some other ideas that may be more useful.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •