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

  • Home
  • SEARCH
  • 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 8477201
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T18:23:45+00:00 2026-06-10T18:23:45+00:00

Does anyone know were I can find a tutorial for how to do horizontal

  • 0

Does anyone know were I can find a tutorial for how to do horizontal parallax scrolling via js form scratch (i.e. no plug-in)? Or can provide me with an example

I’ve spent tons of time Googling it, but could only find tutorials using plug-ins

The reason I want to do it from scratch is because I want a perfect understanding of how parallax truly works.

I don’t mind using the jQuery library I just don’t want to rely on a plugin for the effect.

  • 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-10T18:23:47+00:00Added an answer on June 10, 2026 at 6:23 pm

    A simple tutorial

    See: http://www.egstudio.biz/easy-parallax-with-jquery/

    You can apply that code to 5/6 elements (with different scaling) and create a great, simple parralax effect based on the users mouse.

    Here is an example, thanks to Shmiddty: http://jsfiddle.net/4kG6s/1

    “And here’s the same setup with the code from @PezCuckow’s answer”

    By scaling I mean something like this (edited from above)

    var strength1 = 5;
    var strength2 = 10;
    var strength3 = 15;
    $("html").mousemove(function(e){
        var pageX = e.pageX - ($(window).width() / 2);
        var pageY = e.pageY - ($(window).height() / 2);
        var newvalueX = ;
        var newvalueY = height * pageY * -1;
        $('item1').css("background-position", (strength1 / $(window).width() * pageX * -1)+"px "+(strength1  / $(window).height() * pageY * -1)+"px");
        $('item2').css("background-position", (strength2 / $(window).width() * pageX * -1)+"px "+(strength2  / $(window).height() * pageY * -1)+"px");
        $('item3').css("background-position", (strength3 / $(window).width() * pageX * -1)+"px "+(strength3  / $(window).height() * pageY * -1)+"px");
    });
    

    Without a library such as jQuery the parallax effect would be rather difficult to implement, you’d need to manually implement all the animation rather than using the features provided in the library.

    That being said however an approximate guide is something like the below implements a very poor parallax effect where the backgrounds are moving at different speeds.

    CSS:

    #bg1, #bg2, #bg3 {
        background-image:url('stars.gif');
        height: 100%;
        width: 100%;
        position: absolute;
        left: 100%;
    }
    

    HTML:

    <div id="bg1"></div>
    <div id="bg2"></div>
    <div id="bg3"></div>
    

    JS:

    while(true) {
      document.getElementById('bg1').style.left = (document.getElementById('bg1').style.left) - 4 + 'px';
      document.getElementById('bg2').style.left = (document.getElementById('bg2').style.left) - 10 + 'px';
      document.getElementById('bg3').style.left = (document.getElementById('bg3').style.left) - 20 + 'px';
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does anyone know where can I find a tutorial or example on how to
Does anyone know where I can find an example or a tutorial of building
Does anyone know where I can find a good explanation/tutorial of what and how
Does anyone know where I can find a good tutorial for setting up apache
Does anyone know a tutorial or an example on how can i run a
Does anyone know where I can find a tutorial on how to use GStreamer
Does anyone know where can I find recent data on PHP4 vs PHP5 market
Does anyone know if I can find an emacs color syntax configuration which resembles
Does anyone know where I can find a good video to explain version control
Does anyone know where i can find such a AMI? Oracle database Enterprise Edition

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.