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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T07:31:21+00:00 2026-06-01T07:31:21+00:00

I am newbie in JS. Right now i am working on an effect in

  • 0

I am newbie in JS. Right now i am working on an effect in which i want when page scroll first time then the natural motion animation starts but it’s creating a problem because when i scroll the element animation became fast.

Check this more you got the idea.

http://jsfiddle.net/byvLy/

  • 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-01T07:31:22+00:00Added an answer on June 1, 2026 at 7:31 am

    i know that this is a swinging box (figured it out due to the Math.sin())

    however, you have to note that scrolling event is fired every few milliseconds during scrolling. in your code, you are calling animate and creating an interval every time the scroll event is fired. that’s why your animation is jumpy;

    try this instead:

    $(function() {
    
        $(window).on('scroll', function() {
            swing.start('.cloud1, .cloud2');
        });
    
        var swing = (function() {
            var animated = false;
    
            function startAnimation(selector) {
                if (!animated) {
                    var banner = $(selector);
                    var start = 0;
    
                    animated = true;
                    window.setInterval(function() {
                        banner.css('left', 100 * Math.sin(start) + 80);
                        start += 0.1;
                    }, 30);
                }
            }
            return {
                start: startAnimation
            }
        }());
    });​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am newbie to iphone technology,right now i m working with an application where
I'm a super newbie in RoR. Right now I'm working on this interesting Rails
I'm a newbie in android, working on list adapters right now. I know some
I'm a complete newbie and working on the following page: http://mockingbirdagency.com/thebox/tvshow.html The pull right
I am really newbie at RegExp's and I can't build it right now, so
I'm working on a browser-based RPG for one of my websites, and right now
I'm a newbie in grails. i'm having a problem right now in my domain
I am a Haskell newbie, though had a previous Lisp/Scheme experience. Right now I
I'm a newbie for odbc. Right now I'm connecting odbc successfully to mysql. Is
So right now I have a class called Clans which list several different clans

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.