Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3754520
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T09:33:27+00:00 2026-05-19T09:33:27+00:00

I created a demo: http://pastebin.me/584b9a86d715c9ba85b7bebf0375e237 When the scroll bar is at the bottom and

  • 0

I created a demo: http://pastebin.me/584b9a86d715c9ba85b7bebf0375e237

When the scroll bar is at the bottom and you drag items to sort them, it causes the scroll bar to jump up. It seems to do this in FF, Safari, Chrome, and IE (at least IE8).

In Firefox on my Mac, it does the jump up when the scroll bar is at the bottom, but also adds a nice flash to the whole list. It just flashes the whole list right as it scrolls it up. I believe that if I figure out what is causing the scroll up (and if I can stop it), the flashing will stop as well.

I don’t like it jumping up like that b/c I find it jarring and confusing. I know this is a bit of a corner case, but I’d like to fix it if I could.

So, is there any way to prevent it from scrolling up? Alternately, what is causing it to scroll up?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T09:33:27+00:00Added an answer on May 19, 2026 at 9:33 am

    The problem is very simple.

    First let’s set up the scenario. You have a list of sortable elements, your page is higher than your screen so it has a scrollbar, your page is at the very bottom, the scroll bar all the way down.

    The issue, you go to drag an element which causes jQuery to remove it from the dom then add in a placeholder. Let’s slow it down, it removes the element first, now the list is shorter causing the page to be shorter, causing the scrollbar to be shorter. Then it adds the placeholder, now the page is longer, now the srollbar is longer (but the window doesnt scroll back down, so it appears the scroll bar jumped up).

    Best way I found to counteract this would be to ensure the sortable list has a static height, so removing an element doesn’t cause it to go shorter. One method of doing this would be

    create:function(){
        jQuery(this).height(jQuery(this).height());
    }
    

    The above will be called upon the creation of the sortable list, staticly setting its height to it’s current height.

    If you have pictures in one of the sortable elements, the above code will not work unless you pre-define the dimensions in the tag. Reason is that when the height() is called and set, it’s calculating before the image is filled out. No dimension, then the image accounts for no space. Once the image loads, then will it take up space.

    Here is a way around having to define dimensions. Simply resize the list height every time an image within is detected to be loaded.

    create:function(){
        var list=this;
        jQuery(list).find('img').load(function(){
            jQuery(list).height(jQuery(list).height());
        });
    }
    

    Final version:

    jQuery(document).ready(function(){  
        jQuery("div#todoList").sortable({
            handle:'img.moveHandle',
            opacity: 0.6,
            cursor: 'move',
            tolerance: 'pointer',
            forcePlaceholderSize: true,
            update:function(){
                jQuery("body").css('cursor','progress');
                var order = jQuery(this).sortable('serialize');
                jQuery.post("/ajax.php?do=sort&"+order,function(data){jQuery("body").css('cursor','default');});
            },
            create:function(){
                var list=this;
                var resize=function(){
                    jQuery(list).css("height","auto");
                    jQuery(list).height(jQuery(list).height());
                };
                jQuery(list).height(jQuery(list).height());
                jQuery(list).find('img').load(resize).error(resize);
            }
        });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created the following demo: http://thedrivepartnership.com/overflow.html The scrolls expand fine in FireFox /
Here is a link to the demo: http://davidwalsh.name/xbox-api I created a php file with
I created a simple demo here that demonstrates the problem: http://jsfiddle.net/boblauer/eCugY/ Basically, I want
I've created a simple demo of a light-test-thing here: http://jsfiddle.net/CGr9d/ When I record the
I created two demos: Demo 1: http://jsfiddle.net/DqvTa/7/ Demo 2: http://jsfiddle.net/DqvTa/8/ The demos are almost
http://tinkerbin.com/pla4NzJ9 I've created a tiny demo, where a backbone view is instantiated and using
How to use THREE.ImageUtils.loadTexture() in jsfiddle. I have created a demo [ http://jsfiddle.net/georgeneil/cfrsj/10/ ].
Link to my actual flash demo: http://nside-elite.techiedesign.net/redbox/flashtest.html I created this navigation using Adobe Flash
Based on Raphael demo: http://raphaeljs.com/australia.html I have created objects that changes their colour. But
For example http://www.mysite.com is my site and I created some demo site with same

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.