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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T03:44:47+00:00 2026-06-16T03:44:47+00:00

I’m working on a single-page website and I am trying to make a dynamic

  • 0

I’m working on a single-page website and I am trying to make a dynamic background animation on scroll. Let’s say that I have 4 different sections to my website. For each different section, I have a different background.

Using jQuery, I was able to retrieve the percentage of the scroll that is being used. So let’s say that each of my section are at 25% intervals (not entirely true, but this is only to picture what I am trying to achieve…). So at 0-25% backgroundA, at 25-50% backgroundB, at 50-75% backgroundC and 75-100%, backgroundD.

The background are similar but they rebound on each side of the website, similar to a ping-pong ball. The icon also change, so for example my first background might be a House image of 100px by 100px on the left, while the 2nd background might be a magnifying glass image on the right, still 100px by 100px.

Now, what I want to do is to make some kind of “fluidity” between the backgrounds, so it seems like as if the backgroundA was gradually transforming into backgroundB.

I have seen this kind of behavior on some websites so I am fairly sure it is possible… However, not quite sure how to do it.

If you need any more clarification, let me know.

Thanks ! 🙂

  • 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-16T03:44:48+00:00Added an answer on June 16, 2026 at 3:44 am

    With the example given to your OP, the method that you may be looking for is to overlap background images slightly, vertically (where the lines seem to wrap over each other) and based on the scrollTop position, “step” functions are triggered on each of these backgrounds to animate widths (check the script on the page called bg.js). Within each “step,” these functions change the widths of the background images based upon some math formula — something like (scrollTop * (heightCurrentBg – currentWidth). All of which on the front-end, makes it seem as if it is one fluid line moving/bouncing back and forth.

    Edit — As far as using scroll position to interact with the elements on the page, here is an example that I just whipped up, for the top nav floating element – http://jsfiddle.net/jmsessink/MyL6Y/2/

    Notice that all of the magic happens in the math –

    page.$window.scrollTop() / (page.bodyHeight - page.windowHeight) * (page.navWidth - page.navDivWidth);
    

    Hopefully that gives you a good start on your project.

    Edit #2 — here’s an example of how I would code what you’re trying to do (just replace the background colors with a background image of angled lines) –
    http://jsfiddle.net/jmsessink/MyL6Y/3/

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

Sidebar

Related Questions

I'm trying to create an if statement in PHP that prevents a single post
Let's say I'm outputting a post title and in our database, it's Hello Y’all
That's pretty much it. I'm using Nokogiri to scrape a web page what has
Basically, what I'm trying to create is a page of div tags, each has
I have a small JavaScript validation script that validates inputs based on Regex. I
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I'm working with an upstream system that sometimes sends me text destined for HTML/XML

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.