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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T13:39:39+00:00 2026-06-03T13:39:39+00:00

I use this code: $(img.cloudcarousel).each(function(i, e){ coords[i] = $(e).offset(); }); to save the position

  • 0

I use this code:

$("img.cloudcarousel").each(function(i, e){
  coords[i] = $(e).offset();
});

to save the position of the images (and it works).
Then I animate them and move them.
Then I use this code:

 $("img.cloudcarousel").each(function(i, e){
   $(e).animate({top:coords[i].top, left:coords[i].left}, 1000);
 });

to animate them back to where they belong.
in IE (at least 8) it works fine but in Chrome and Firefox it animates 40-50 pixels too much to the left and down (like its over-animating).

dont ask me how I discovered this: when i use mousewheel over them they go to where they belong!

I guess it’s somehow related to the buildup of the animation queue, however I only use four images and it doesn’t fix on its own after x time, only on the mousewheel stuff.

edit : added to jsfiddle.net

I’m not really sure how that site works but I added my HTML and JS into it:

http://jsfiddle.net/3wqYg/

  • 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-03T13:39:40+00:00Added an answer on June 3, 2026 at 1:39 pm

    The $(e).offset() is not returning the values that is currently defined in your fiddle. I have not looked up the definition of offset but if you output the coords, you will see it is not the same as in the code

    Edit: I see the problem see offset() http://api.jquery.com/offset/ it returns the x, y relative to document BUT when you animated it back it is relative to the parent element (default behavior). So in the doc it mentions using position(). that is relative to the parent element, I have not tried it but if you use that it should work.

    Final Edit: yep works fine with position see http://jsfiddle.net/3wqYg/1/ you must copy it into a test page because it does not animate on fiddle

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

Sidebar

Related Questions

Look at the code below: $(.head img).hover(function(){ var id = $(this).attr('id'); $(this).attr(src,images/+id+_hover.gif); },function(){ var
i am use this code to upload image ..this code save uploads url into
I have this code in jquery: var ratio; $(<img/>).attr(src, $(img).attr(src)).load(function() { ratio = this.width
I use this css code in my website: img { max-height: 800px; max-width: 600px;
I have this code: document.getElementById('img'+i).onclick = function(){popup_show('popup',array_msg[i]+'|||'+date('Y-m-d',strtotime(lec_date))+'-==-'+str_view_forConflict, 'AddEditSchedule;;popup_drag2;;EditSched;;'+String(array_msg_id[3])+';;view', 'popup_drag', 'popup_exit', 'screen-center', 0, 0);}; ...but
I need to fit images to the viewport/window size. I use this code for
It is Legal to use this code: <img src=...(here image).... width=50px height=50px /> Or
if i use this code (with spaces between the two tags): <img src=..... style=border:0px;margin:0px
Using this code: $.each(data.toptracks.track, function(index, item){ $('.lastfm').append('<figure class=clearfix><p><a href='+item.url+'>'+item.name+'</a>'+item.artist.name+'</p><div class=vinyl><img class=recordLabel src=' + item.image[3]['#text']
trying to use this function http://php.net/manual/en/function.strip-tags.php against this: [link-code-html] => <a href=http://www.kqzyfj.com/click-3782261-10563989>invisibleSHIELD for the

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.