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

  • SEARCH
  • Home
  • 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 1115941
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T03:13:53+00:00 2026-05-17T03:13:53+00:00

I have been working with jquery-ui’s sortable demo for a while. On looking closely,

  • 0

I have been working with jquery-ui’s sortable demo for a while.

On looking closely, I found that it nudges the divs slightly.

Here’s an online demo : http://jsbin.com/ijusu3

Try moving the the center one to the left, then you can see the right ones nudging about 2 pixels to the left.

I would like to know why. This has been messing up the rest of my functionality.

PS: If jsbin doesnt show the code, here it is:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8" />
    <title>jQuery UI Sortable - Portlets</title>
    <link rel="stylesheet" type="text/css" href="css/ui-darkness/jquery-ui-1.8.2.custom.css" /> 
    <script type="text/javascript" src="lib/jquery-1.4.2.min.js"></script>
    <script type="text/javascript" src="lib/jquery-ui-1.8.2.custom.min.js"></script>
    <style type="text/css">
    .container { width: 788px; height: 405px; }
    .column { width: 78px; height:405px; display:table-cell; vertical-align:bottom;}
    .portlet { width: 78px; height: 10px; display: block; position:relative; }  
    </style>
    <script type="text/javascript">
    $(function() {

        $(".column").sortable({
            connectWith: '.column',
            helper:'original'
        });

        $(".portlet").addClass("ui-widget ui-widget-content ui-corner-all");

        $(".column").disableSelection();
    });
    </script>
</head>
<body>

<div id="container" class="container">

    <div id="col-0" class="column">

        <div class="portlet" id="feeds">
            <div class="portlet-content"></div>
        </div>

        <div class="portlet" id="news">
            <div class="portlet-content"></div>
        </div>

    </div>

    <div id="col-1" class="column">

        <div class="portlet" id="shopping">
            <div class="portlet-content"></div>
        </div>

    </div>

    <div id="col-2" class="column">

        <div class="portlet" id="links">
            <div class="portlet-content"></div>
        </div>

        <div class="portlet" id="images">
            <div class="portlet-content"></div>
        </div>

    </div>

</div>
</body>
</html>
  • 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-17T03:13:53+00:00Added an answer on May 17, 2026 at 3:13 am

    The reason is very simple really (though I cannot be sure if this is actually the reason until I see your CSS).

    When you add the ui-widget class to those divs, you’re also adding a 1px wide border. The border takes up one pixels on either side of those div in addition to the 78px you defined as their width, thus their actual width is 80px.

    This, combined with the fact that you’ve specified a 78px width for the columns, means that the columns are too narrow for their content, thus when the last element is removed the column reverts back from 80px to 78px.

    I had to modify your jsbin demo to work with jQuery and jQuery UI, so the CSS isn’t the same as the one you’re using, thus I might be wrong about this. Changing the column width to 80px stopped the columns from shifting around.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been working on a JQuery script that posts JSON to my asp.net
I have been working on a jquery plugin that uses a HTML5 audio player
So I have been working on this phone gap application that uses jquery-mobile. Recently,
I have been working with jquery for a while so this is quite embarrassing
I have been working on a jQuery plugin that involves CSS Shapes . The
I have been working with this JQuery image carousel for a while, and am
I have been working for a client that is using the tristate jquery plugin
I have been working with jQuery mobile 1.0.1. I have a page which drills
Alright have been working to switch to jQuery 1.7's new and improved .on() function
I'm working on a asp.net mvc2 app. I have been using jquery to do

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.