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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T10:33:06+00:00 2026-06-10T10:33:06+00:00

I am trying to animate a kangaroo jumping along a sine wave on page

  • 0

I am trying to animate a kangaroo jumping along a sine wave on page scroll but having been out of school for almost 15yrs am unable to workout the math I need to make this happen. I have got somewhere close in my attempt below, but it looks like the Kangaroo is having an epileptic fit and jumps up and down all over the place.

Here is my CSS

.bgRoo{
    position: fixed; 
    background: url(../images/bg-roo.png) no-repeat; 
    width: 225px; height: 239px; 
    left: 50%; margin-left: 250px; 
    border: red; margin-top: 400px;}

and my jQuery

$(window).bind('scroll',function(e){
        parallaxScroll();
    });

    function parallaxScroll(){
        var scrolledY = $(window).scrollTop();
        $('.bgRoo').css('top',''+((Math.sin(scrolledY)*30)+(scrolledY*0.1))+'px');
        $('.bgRoo').css('margin-left',(250+scrolledY)+'px')
    }

Anyone care to take a go at this?

  • 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-10T10:33:08+00:00Added an answer on June 10, 2026 at 10:33 am

    It’s probablly because its a bit sensitive to scrolling changes…. maybe Math.sin(scrolledY) should be Math.sin(scrolledY/30) or so. the number (scrolledY) passed into Math.sin is in radians so …. every 6.28ish is a full sine wave. meaning currently every 6 pixels ish it’s going through a full sine loop, meaning scrolling probablly looks pretty random.

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

Sidebar

Related Questions

I trying animate a horizontal scroll, but get a litle bug in IE and
Trying to animate background color on page load but it only works when I
I am trying to animate sliding out one view from a window and simultaneous
I'm trying to animate a div so that when the page load it has
I am trying to animate my #main div so that it fades out and
I'm trying to animate a list item the same way asmselect does but it
I'm trying to animate drop up using negative top, the animation went okay, but
I was trying to animate a sprite only once but it is animated twice
I'm trying to animate an image (used as background image but it doesn't really
I'm trying to animate a custom UIButton but my code doesn't seems to work.

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.