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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:29:28+00:00 2026-05-26T20:29:28+00:00

I’m trying to build a page where I can have 3 layers. 1 –

  • 0

I’m trying to build a page where I can have 3 “layers”. 1 – background, 2 – images and 3 – images.

I already achieve that using the animate jQuery function and it works perfectly when I’m working with the navigation menu. However I’d like to have the same effect when the users scrolls the browser console/window (Internet Explorer, Chrome, Firefox…). I don’t know if I’m being clear so this is a page that I found with a similar effect: http://johanreinhold.com/

I’m searching for a while and I didn’t get it yet. How do I fix this problem?

My code for animate is

function goto(id)
{
    $('html,body').animate({scrollTop: $("#"+id).offset().top},2000);
    $('html,body').clearQueue();
}
  • 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-26T20:29:29+00:00Added an answer on May 26, 2026 at 8:29 pm

    I’m not entirely sure what you mean either (so my apologies to both you and @mrtsherman if his answer’s the one you want), but I think you’re asking how to get a parallax scrolling effect. The site you linked to uses MooTools

        $$("#floaters-0, #floaters-01, #floaters-02, #floaters-1, #floaters-11, #floaters-12, #floaters-2, #floaters-21, #floaters-22, #floaters-3, #floaters-31, #floaters-32").each(function(item) {
            item.store('top', parseInt(item.getStyle('top')));
            item.store('y', item.getPosition().y);
            item.store('friction', parseFloat(item.get("data-friction")));
        });
    
        this.addEvent('scroll', verticalParallax);
    
    function verticalParallax(e) {
    
        var windowScrollY = window.getScroll().y;
    
        $$("#floaters-0, #floaters-01, #floaters-02, #floaters-1, #floaters-11, #floaters-12, #floaters-2, #floaters-21, #floaters-22, #floaters-3, #floaters-31, #floaters-32").each(function(item) {
    
            if ((windowScrollY) >= item.getPosition().y)
                item.setStyle("top", item.retrieve('top') + (windowScrollY - item.retrieve('y')) * item.retrieve('friction'));
        });
    };
    

    jQuery

    I’ve moved it over to jQuery (in a rough and ready sort of way) and stuck it in a JSFiddle here http://jsfiddle.net/meloncholy/FhxZ3/1/

        $(function ()
        {
            $(".float").each(function ()
            {
                var $this = $(this);
    
                $this.data("startTop", $this.offset().top);
            });
    
            $(window).scroll(function ()
            {
                var documentScrollTop = $(document).scrollTop();
    
                $(".float").each(function ()
                {
                    var $this = $(this);
    
                    $this.offset({ top: $this.data("startTop") + documentScrollTop * $this.data("friction"), left: $this.offset().left });
                });
            });
        });
    

    CSS

        .float { display: block; left: 100px; position: fixed; }
    
            #float-1 { top: 50px; }
    
            #float-2 { top: 400px; }
    
            #float-3 { top: 850px; }
    
        .content { font-size: 48px; position: relative; z-index: 2; }
    

    The code hooks into the scroll event and adjusts the images’ positions when it triggers. The amount of scrolling is controlled with by the friction property, so setting it to 0.5 as in the example means they should move at half the rate of the text. It turns out (though I guess it’s obvious in retrospect) that it’s important to set the parallax elements to have position: fixed or you’ll get some nasty jumping.

    As I said, this is a bit rough and ready (in particular other sites often only run the parallax effect in a certain vertical window), so you may want to hit Google for parallax scroll jquery or something and take a look at how someone else did this properly. 🙂

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

Sidebar

Related Questions

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'm new to using the Perl treebuilder module for HTML parsing and can't figure
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
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
We're building an app, our first using Rails 3, and we're having to build
I'm trying to create an if statement in PHP that prevents a single post
I have thousands of HTML files to process using Groovy/Java and I need to
I am trying to loop through a bunch of documents I have to put

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.