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 7072109
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:46:08+00:00 2026-05-28T05:46:08+00:00

I have a jquery scrollable that is not constrained to be within it’s parent.

  • 0

I have a jquery scrollable that is not constrained to be within it’s parent. When I drag it such that it forces the body to autoscroll beyond it’s width it “looks” like things are working.

However, when I click on my element after this point it gets a “strange” location and appears to disappear (it has to do with the location being set to a negative value).

I noticed that even the jquery example for this stuck a very tall (and narrow) div to help with this. However, their example seems to work horizontally as well.o

Here’s a link to what I’m referring to: http://hortitude.com/samples/drag_and_drop/drag_drop.html

Relevant source code:

<html>
<head>
    <script type="text/javascript">
       $(function () {
          $(".blueguy").draggable();
          $(".greenguy").draggable({ scroll: false, containment: 'parent' });
       });
    </script>

    <style type="text/css">
      .blueguy {
         background-color: #0000ff;
      }
      .greenguy {
         background-color: #00ff00;
      }
    </style>

</head>
<body style="height:100%;">
<div  style="height:100%;">
<div class="blueguy" style="width:300px; height:150px;">Drag me "off screen" such that the browser window auto scrolls.  Then click on me and I dissapear</div>
<div class="greenguy" style="width:300px; height:150px;">I am constrained to the be contained within my parent</div>


</div>
</body>
</html>

The real question is: Why does this happen? I know I could work around this with extra divs that are big, but I’m just curious as to why I see this?

Additionally, it would be interesting to know if there are other good work-arounds.

  • 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-28T05:46:08+00:00Added an answer on May 28, 2026 at 5:46 am

    i could reproduce the behavior. but it happens not on click, it happens if you drag the element off screen and will try to drag it back after that.
    the effect is even stronger if you scroll to the end first, so that if you drag the element off screen to the right, first put the scrollbar to the right and then try to drag the item back to the left.

    but what is your actual question?

    it looks kinda buggy to me. scrolling offscreen seems kinda messy in jquery ui draggable.

    funny thing is .. i tried to reproduce that behavior where i wrapped up both divs in a container and the “scrolling back” is extremly fast but the item never jumps away from under the mouse, so nothing “disappears”, see here http://jsfiddle.net/hFAru/17/.
    would that be kind of a fix for you?

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

Sidebar

Related Questions

I am using the jQuery Tools Scrollable plugin - http://flowplayer.org/tools/scrollable.html#navigator I have created a
I have jQuery to select all font elements that are children of the element
does jquery have any plugin that prevents entering any input to a textbox that
I have a really stuburn layout, that I just can not resolve .. -
I have jquery code that is being reused by a repeatable partial view on
I have a scrollable panel that shows content larger than the screen new Ext.Panel({
I have a parent div that is filled with multiple child divs (see here
I have a div that scrolls (the main page does not have scrollbars) and
I have a scrollable div that contains a table with many rows (100+). I
Does anyone know of a JQuery plugin that could make any <div> scrollable? I

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.