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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:26:36+00:00 2026-05-25T19:26:36+00:00

Having some problems with a piece of Jquery code, well that’s where I think

  • 0

Having some problems with a piece of Jquery code, well that’s where I think the problem is – On FF when the page loads after 2 seconds it animates panels from the left of the screen to the right. It looks fine without any issues but in Chrome and IE it jumps back and continues moving across.

Here is the code –

<script type="text/javascript" language="javascript">

$(function() {

   // Display div slowly
    $('#one').delay(2000).show('slow');
    $("#one").animate({
        left: '+=159'
    }, 3000);


    $('#two').delay(3000).show('slow');
    $("#two").animate({
        left: '+=159'
    }, 3000);

    $('#three').delay(4000).show('slow');
    $("#three").animate({
        left: '+=159'
    }, 3000);

    $('#four').delay(5000).show('slow');
    $("#four").animate({
        left: '+=159'
    }, 3000);
    });

 </script>

Here is a preview of the page – http://www.visrez.com/preview/och-group/

P.S I’m not ruling out it’s a css issue…

Thanks in advance for any help!

Gearóid

  • 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-25T19:26:37+00:00Added an answer on May 25, 2026 at 7:26 pm

    The problem stems from the fact that Chrome isn’t taking into account the position (relative to the offset parent) that div has on the page before you start moving it. So, once animated, it has a value of left: 159px which is relative to the body. Firefox is taking the original position into account and ends with left: 256px.

    I haven’t looked into why this happens yet but here are a few things that you could do (workarounds):

    1. Before animating figure out the position relative to the offset parent and set the CSS top and left attributes. Then, hopefully, the final value will be the value that you set plus 159px. Something like:

      var offset = $("#one").offset();
      $("#one").css({"top": offset.top, "left": offset.left});
      // animate
      
    2. Wrap #oneTop and #one and each other pair in a div that is position: relative. This will set the offset parent of the animated div to the position: relative div. This way the +159px is relative to where the div would be in the document.

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

Sidebar

Related Questions

I'm having some problems with this piece of code. I've included a class declaration
I'm having some problems with a certain piece of code which sits in my
I'm having a problem with a piece of code that's starting to drive me
I am having some problems parsing this piece of XML using SimpleXML. There is
I'm having some problems with the following code: private class ClientPluginLoader : MarshalByRefObject {
I am having some problems getting a small piece of text to be centered
I'm having some problems with encapsulation in C#. There are two specific scenarios that
I am having a slight problem with this piece of code as I am
I'm having some trouble with a particular piece of code, if anyone can enlighten
Currently having some problems- now = datetime.datetime.now() month = now.strftime(%B) site = wikipedia.getSite('en', 'wikiquote')

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.