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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T20:36:44+00:00 2026-05-31T20:36:44+00:00

I have some particular need to clone an element (image) and be draggable inside

  • 0

I have some particular need to clone an element (image) and be draggable inside a container and still retain its draggable (but not clone) once inside.

I want to make only the cloned elements dragged inside the container to also be re-sizable, but I cannot get it to work.

I can only get the parent element to resize. Is there any way to only .resize the cloned element?

Somewhat wonky but working example: http://jsfiddle.net/rGUma/4/

Code:

<div class="drag"><img src="..." /></div>
<div class="drag"><img src="..." /></div>
<div class="drag"><img src="..." /></div>
<div class="drop-zone"></div>


  <script>
    $(".drop-zone").droppable({
        accept: '.drag',
        drop: function(event, ui) {
            var $clone = ui.helper.clone();
            if (!$clone.is('.inside-drop-zone')) {
                $(this).append($clone.addClass('inside-drop-zone').draggable({
                     containment: '.drop-zone'
                }));
            }
        }
    });
    $(".drag").draggable({
        helper: 'clone'
    });

    //this works but I dont want it on outside elements
     $( '.drag' ).resizable({  
      helper: "ui-resizable-helper"
    });

     //this doesn't work on cloned images but what I want working       
    $( '.drop-zone img' ).resizable({  
      helper: "ui-resizable-helper"
    });        

    // '.inside-drop-zone img'  also doesnt work

});​

</script>

ps. If someone can explain why it doesn’t work it would be greatly appreciated.

  • 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-31T20:36:45+00:00Added an answer on May 31, 2026 at 8:36 pm

    It doesn’t work because the clone is never set to be resizable. The .resizable is only applied to the elements that exist in the beginning, not to any new elements you create.

    I move the resizable call into the cloning portion to apply it to the clone. This also means that the outside boxes are not resizable, per your comments int the source (updated jsfiddle):

    $(document).ready(function($) {
    
        $(".drop-zone").droppable({
            accept: '.drag',
            drop: function(event, ui) {
                var $clone = ui.helper.clone();
                if (!$clone.is('.inside-drop-zone')) {
                    $(this).append($clone.addClass('inside-drop-zone').draggable({
                        containment: '.drop-zone'
                    }));
    
                    $clone.resizable({ //this works but I dont want it to on outside elements
                        helper: "ui-resizable-helper"
                    });
                }
            }
        });
        $(".drag").draggable({
            helper: 'clone'
        });
    
    
        $('.drop-zone img').resizable({ //this doesn't work because its cloned "inside" but its what I want working
            helper: "ui-resizable-helper"
        });
    
    
        // '.inside-drop-zone img'  also doesnt work
        // 
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For some reason, z-index is working for one particular element in IE8, but not
I have some text in a string, I need to check whether that particular
I have a project to build, where I need find some particular installed application
I have downloaded some files from the internet related to a particular topic. Now
Here's the situation: On a particular branch, some changes have been merged in from
I have some files that are uuencoded, and I need to decode them, using
I have a newbie question in JSF, and particular in Richfaces. I need my
I have a particular need which I cannot seem to figure out. I've done
I have some SVG embedded into a web page and need to copy a
I have an iphone app, and I need to capture some data right as

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.