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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T01:36:08+00:00 2026-05-20T01:36:08+00:00

I want to have an object which is both resizable and draggable. I’ll need:

  • 0

I want to have an object which is both resizable and draggable. I’ll need:

  • X
  • Y
  • Size

of the object.

Is this possible?

There is an example on http://www.jsfiddle.net/davidThomas/DGbT3/1/ which gets the x and y of the draggable object. How can I also make it resizable?

Thanks


It’s worth adding that this question is related to, and built on, this previous question: How to get the position of a draggable object?

  • 1 1 Answer
  • 1 View
  • 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-20T01:36:08+00:00Added an answer on May 20, 2026 at 1:36 am

    Sure it is… jQuery UI is good for complex behaviors like drag and drop, resizing, selection and sorting.

    With jQuery UI you can:

    • Drag
    • Drop
    • Resize
    • Sort

    And you can everything chain together.

    It is important for the resize feature that you include the jquery-ui.css file.

    JSFIDDLE: http://jsfiddle.net/uQWRk/

    Here is the full code for archive:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <html lang="en">
    <head>
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.js"></script>
        <link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.1/themes/base/jquery-ui.css"/>
    
    <script type="text/javascript" charset="utf-8">
        $(document).ready(function() {
    
            $('#dragThis').resizable({
                stop: function(event, ui) {
                    var w = $(this).width();
                    var h = $(this).height();
                    console.log('StopEvent fired')
                    console.log('Width:'+w);
                    console.log('Height:'+h)    
                }
            }).draggable(
                {
                    containment: $('body'),
                    drag: function(){
                        var offset = $(this).offset();
                        var xPos = offset.left;
                        var yPos = offset.top;
                        $('#posX').text('x: ' + xPos);
                        $('#posY').text('y: ' + yPos);
                    },
                    stop: function(){
                        var finalOffset = $(this).offset();
                        var finalxPos = finalOffset.left;
                        var finalyPos = finalOffset.top;
    
                $('#finalX').text('Final X: ' + finalxPos);
                $('#finalY').text('Final X: ' + finalyPos);
                    }
                });
    
            $('#dropHere').droppable(
                {
                    accept: '#dragThis',
                    over : function(){
                        $(this).animate({'border-width' : '5px',
                                         'border-color' : '#0f0'
                                        }, 500);
                        $('#dragThis').draggable('option','containment',$(this));
                    }
                });
        });
    
    </script>   
    <style type="text/css">
        #dragThis {
            width: 6em;
            height: 6em;
            padding: 0.5em;
            border: 3px solid #ccc;
            border-radius: 0 1em 1em 1em;
            background-color: #fff;
            background-color: rgba(255,255,255,0.5);
        }
    
        #dropHere {
            width: 12em;
            height: 12em;
            padding: 0.5em;
            border: 3px solid #f90;
            border-radius: 1em;
            margin: 0 auto;
        }
    </style>
    </head>
    <body>
    <div id="dragThis">
    <ul>
        <li id="posX"></li>
        <li id="posY"></li>
        <li id="finalX"></li>
        <li id="finalY"></li>
    </ul>
    </div>
    <div id="dropHere"></div>
    </body>
    </html>
    

    See comments:
    enter image description here

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

Sidebar

Related Questions

I have this object which is an instance of a superclass. I want to
I have 2 objects, both of which I want to convert to dictionarys. I
I have an object which I first want to rotate (about its own center)
I have an object for which I want to generate a unique hash (override
I have a productVariant object which has child product object. I want to show
I have an object, and I want to list all the selectors to which
Lets say I have a single object of type Car which I want to
I have a page in which I want to maintain the value of object
I have a method which never returns a null object. I want to make
I have an object which has both a copy constructor and assignment operator defined.

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.