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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T12:44:50+00:00 2026-05-21T12:44:50+00:00

In the JQueryUI draggable demo , I can see you can attach a handle

  • 0

In the JQueryUI draggable demo, I can see you can attach a handle to a DIV but if the handle is not nested within the parent DIV that is draggable, it doesn’t work e.g.

<script src="jquery-1.5.2.js"></script>
  <script src="js/jquery-ui-1.8.11.custom.min.js"></script>

  <style>    
    #hBlack
    {
        width:55px;
        height:55px;
        background-color: black;
        top:0px;
    }

    #hGreen
    {
        width:25px;
        height:25px;
        background-color: green;


    }
  </style>
  <script language="javascript" type="text/javascript">
    $(function() {
      $("#hBlack").draggable({handle:"#hGreen"});
      });
  </script>
</head>

<body>
  <div id="hBlack">
</div>
<div id="hGreen"></div>

The above doesn’t make #hGreen the handle – but the following does:

<div id="hBlack">
  <div id="hGreen"></div>
</div>

Essentially, I am trying to make one DIV move when another moves – I guess you can do it with the new Position utility but for a newbie like me I find it poorly documented

  • 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-21T12:44:50+00:00Added an answer on May 21, 2026 at 12:44 pm

    One possible solution could be to have the handle inside, but use css to position it outside.

    Javascript:

    $("#draggable").draggable({handle:"#handle"});
    

    HTML:

     <div id="draggable">draggable
    <div id="handle">handle</div>
     </div>
    

    CSS:

    #draggable{
    display: block; 
    height: 300px; 
    width: 600px; 
    background-color: gray;
    }
    #handle{
    display: block; 
    height: 50px; 
    width: 600px; 
    background-color: green;
    position: relative;
    top: -30px;
    }
    

    Otherwise, you might have to do something similar to a multiselect draggable.
    How do I drag multiple elements at once with JavaScript or jQuery?

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

Sidebar

Related Questions

So i have a nested jqueryui sortable and a draggable item that i can
http://jqueryui.com/demos/accordion/ You can do $('#itename').accordion('activate', 0) to make an accordion closed but that'll change
I wish to to use jQueryUI's draggable widget, but constrain the object so that
Is it possible to modify the clone helper that jQueryUI creates with draggable element?
I'm trying to use jQueryUI draggable/droppable/sortable to move (not copy) items from a source
How can I get the X,Y co-ords of a JQueryUI draggable object, when it
I have a draggable div element that uses HTML 5 localStorage to remember its
I am using the jQuery UI Draggable/Sortable demo (http://jqueryui.com/demos/draggable/#sortable) for the basis of my
I know one can set plugin options, after things are set. But I'm not
On Jquery UI's site: http://jqueryui.com/demos/draggable/ If I have: <div id=someId class=someClass>he</div> <div id=otherId class=otherClass>he2</div>

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.