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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T05:53:39+00:00 2026-06-17T05:53:39+00:00

When someone click on my fields on my virtual game, i get my current

  • 0

When someone click on my fields on my virtual game, i get my current left and top cordinates with this:

 function moveDiv(fromSeat, toSeat){
    var fromTop  = $('#seat-' + fromSeat).css("top");
    var fromLeft = $('#seat-' + fromSeat).css("left");

    var toTop  = $('#seat-' + toSeat).css("top");
    var toLeft = $('#seat-' + toSeat).css("left");

    /** Move a div from point {"fromTop", "fromLeft"} => {"toTop", "topLeft"} **/
  }

I am stuck here, i tried to make a $(‘…’).animate({}); but could not get it working.
I want div “#test” to move from point {“fromTop”, “fromLeft”} => {“toTop”, “topLeft”}

  • 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-17T05:53:40+00:00Added an answer on June 17, 2026 at 5:53 am

    You likely need to add the top values and add the left values and do animation using the totals

    function moveDiv(fromSeat, toSeat){
        var fromTop  = $('#seat-' + fromSeat).css("top");
        var fromLeft = $('#seat-' + fromSeat).css("left");
    
        var toTop  = $('#seat-' + toSeat).css("top");
        var toLeft = $('#seat-' + toSeat).css("left");
    
         var position={ top: fromTop+ toTop, left: fromLeft+toLeft}
    
         $('#seat-' + fromSeat).animate( position);
    
      }
    

    EDIT: need to convert values from string containing px to number to add them. Can use parseInt() to do it

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

Sidebar

Related Questions

Can someone tell me how to install this? I go here: http://api.jquery.com/browser/ and click
I found this on Google, click here , which someone asked a similar question,
I have this function toggles the disabled attribute form a input field: $('.someElement').click(function(){ if
i wants to set focus on the parent div when someone click on the
Can someone explain how the Silverlight 4 OOB upgrades happen? Is it click one?
I've been searching all day for an answer to this, so hopefully someone can
I'm dynamically adding rows/fields in this code. I have a text field for the
I have this snippet of code (AJAX) in jQuery. $.get('someScript.php?lat=' + clickedLatLng.lat() + '&lon='
I'm throwing this up in hope that someone might spot a mistake because I've
I really hope someone can help me with this. Basically i have an issue

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.