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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T02:08:23+00:00 2026-05-17T02:08:23+00:00

for some reason , i can’t use jquery . this is my code: <!DOCTYPE

  • 0

for some reason , i can’t use jquery .

this is my code:

<!DOCTYPE html>
<html>
<head>
</head>
<body >
<style type="text/css">
#draggable
        {
            position: absolute;
            width: 100px;
            height: 100px;
            padding: 0.5em;
            float: left;
            margin: 10px;
            border: 1px solid #DDDDDD;
            color: #333333;
            background: #F2F2F2;
            cursor: move;
            z-index:10;
        }
        #droppable
        {
            width: 150px;
            height: 150px;
            padding: 0.5em;
            float: left;
            margin: 10px;
            border: 1px solid #E78F08;
            color: #FFFFFF;
            font-weight: bold;
            background: #F6A828;
            overflow: hidden;
        }
</style>
<p>
    Eos an invidunt dignissim liberavisse, no paulo alterum vix, mei causae vivendum
    te. Discere omittam ea sed. Est ex mutat aeque discere. Omnes tincidunt pro ea.
    Mentitum expetenda reprehendunt vis id, duo natum adhuc ut. Malis partiendo id duo,
    feugait iudicabit consequuntur at eum.
</p>
<div id="droppable">
    <p>
        Drop here.
    </p>
</div>
<p>
    Ea eam audire antiopam, agam consulatu patrioque no nec. Sea simul insolens ne,
    vero scribentur duo ut. Te mel dico choro virtute. Mel ex sumo omnes.
</p>


<p>
    Eos an invidunt dignissim liberavisse, no paulo alterum vix, mei causae vivendum
    te. Discere omittam ea sed. Est ex mutat aeque discere. Omnes tincidunt pro ea.
    Mentitum expetenda reprehendunt vis id, duo natum adhuc ut. Malis partiendo id duo,
    feugait iudicabit consequuntur at eum.
</p>
<p>
    Ea eam audire antiopam, agam consulatu patrioque no nec. Sea simul insolens ne,
    vero scribentur duo ut. Te mel dico choro virtute. Mel ex sumo omnes.
</p>
<div id="draggable" >
    <p>Drag me to my target</p>
</div>
<script>
function id(id){
    return document.getElementById(id)
}
console.log(id('droppable').offsetWidth,id('droppable').offsetTop)
id('draggable').style.left =id('droppable').offsetWidth+'px'
id('draggable').style.top = id('droppable').offsetTop+'px'

</script>
</body>
</html>

this is the demo http://jsfiddle.net/6H5Yj/

so how to set the ‘draggable’s left Equal the ‘droppable’s left, top Equal top,

thanks

  • 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-17T02:08:23+00:00Added an answer on May 17, 2026 at 2:08 am
    var bound = id('droppable').getBoundingClientRect();
    
    var x= bound.left,y= bound.top 
    
    id('draggable').style.left =x+'px'
    id('draggable').style.top = y+'px'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code. For some reason I can't get the contentpresenter to stretch
For some reason I can't get this to work. It pulls the name and
For some reason I can't get this script to run when I add the
I'm new to Javascript and for some reason I can't get the following code
I'm fairly new to JQuery and for some reason I can't get the currently
for some reason I can't get my head around mustache templating and merging two
For some reason I can't use \n to create a linefeed when outputting to
For some reason i can't seem to get this right ok i have 2
This should be pretty simple but for some reason I can't get this value
For some reason I can't get this batch file to run in my .NET

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.