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 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

Is it possible to modify the clone helper that jQueryUI creates with draggable element?
I'm implementing jquery UI draggable and have 2 of these draggables that you see
Poorly worded question, but I can't find a better way. Also, checked the 'related'
I'm trying to use draggable/droppable in a manner that allows you to drag and
I'm trying to use the jqueryui dialog ( http://docs.jquery.com/UI/Dialog ) within my html page.
My page contains some drag-able div elements ( not jQuery UI dragable ). Now
Let's say I have something set to be dragged: <div class=container> <div id=draggable-1></div> <div
In the jquery ui docs for draggable, we can specify a sortable to connect
I'm using jQuery UI's draggable and droppable libraries in a simple ASP.NET proof of
I'm new to jQueryUI and I think I am overlooking something very basic... Quick

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.