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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T05:08:28+00:00 2026-06-13T05:08:28+00:00

I need to drag an image that is currently under another png image. I

  • 0

I need to drag an image that is currently under another png image.

I thought I could do this easily by using this code:

$(document).ready(function() {
    $(".imageOverlay").mousedown(function(eventObject){
    $('#draggable').drag();
    return false;
    });
});

However it doesn’t seem to work.

You can find an example without the overlying image here

And here is the example with the overlying image here

Any help would be great, please keep your answers relatively simple as I am no guru in jQuery.

Thank you.

  • 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-06-13T05:08:29+00:00Added an answer on June 13, 2026 at 5:08 am

    I managed to get this working by taking the width, height and positioning of the draggable object and giving the underlaying image the same css positioning, width and height.

    This is the code:

        var imgdrag = $(#draggable); //This is the box you drag
        var imgselector = $(.imageUnderlay); //This is the image underneath
    
        //Get the height, width and position of the draggable box
        var height = imgdrag.height();
        var width = imgdrag.width();
        var top = imgdrag.css("top");
        var left = imgdrag.css("left");
    
        //Add the css style to the image underlay
        imgselector.css('top', top);
        imgselector.css('left', left); 
        imgselector.css('height', height + 'px'); 
        imgselector.css('width', width + 'px');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a container that contains an image that I need to drag from
I'm using Flash builder 4.6 for mobile applications. I need to drag an image
I need to upload an image to my site, using either a drag and
I am currently working on a project that similar to http://www.beoplay.com/Products/BeoplayA9#under-the-hood using Javascript, HTML5
I need to create a drag and drop system in swing where an image
i need to be able to drag and drop my picturebox with an image
I am using a custom TreeView class because i need drag-and-drop capabilities. I am
I need to write a sophisticated website that does AJax, drag and drop, component
I'm currently coding a simple image manipulator with C# Bitmaps und Graphics. I'm using
I'm working on a web application that need to allow the user to drag

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.