Jquery Parallax Scrolling effect - Multi directional

25,469

Solution 1

I threw something together is jsfiddle for you.

http://jsfiddle.net/9R4hZ/40/

The script initializes the start positions of all of the objects first. Then handlers are set up for arrow key and mouse wheel. After that is the meat of the algorithm in the parallaxScroll function.

It uses the ARROWS or MOUSEWHEEL for scrolling.

There are from [left, right, top, bottom] transitions.

The HTML and CSS are really simple.

The JS/jQuery that runs it is self explanatory.

It's an interesting effect, that seems to be geared for artsy type sites.

Solution 2

Did you look into librairies like Scrollrama http://johnpolacek.github.com/scrollorama/ or Curtain http://curtain.victorcoulon.fr/?

I know in your question you mention that you already looked into different librairies but depending how they work it's difficult to really suggest how to use proper coordinates.

*edit1

If you didn't see it yet, the auther of scrollorama also did superscrollorama which give a bit more controler over the animation for example animation when an element is pinned.

http://johnpolacek.github.com/superscrollorama/

Solution 3

This article in smashinghub.com shows a collection of JQuery plugin for scrolling and parallax effect I'm totally sure one of them will help you. it looks like jQuery Scroll Path is the most advanced of them or suit your requirements.

Solution 4

I realize I'm jumping in late here, and this might seem ultra obvious, but have you tried reverse engineering what they have done on https://victoriabeckham.landrover.com/INT? It looks like the ScrollAnimator script does a bulk of the work. I would download their site & mess with it locally, subtracting parts until I figured out which components provide which pieces of functionality. Then I would read through those to understand how they made it happen.

Share:
25,469

Related videos on Youtube

Dancer
Author by

Dancer

Digital Designer/ Front-end Developer / App Developer from Liverpool UK. Currently working for Liquid Agency www.liquidagency.co.uk

Updated on July 09, 2022

Comments

  • Dancer
    Dancer almost 2 years

    I need to build a multi-directional JQuery parallax page for a client - they basically want it to work in a similar way to this - https://victoriabeckham.landrover.com/INT

    I have the artwork ready and have found many jquery libraries that will allow me to scroll horiz/vertical - but i'm not sure how to combine both together at a specific co-ordinate. Could anyone please point me in a the right direction?

    Edit: I did originally sign this post off having looked into Superscrolarama and thinking all was solved - but having struggled with implementing it - I dont think its quite the saviour I thought it was, I need both horizontal and vertical parallax as well as scrolling to achieve above, which it doesn't seem to support - so any other tips I'd be very grateful for!

    • Blazemonger
      Blazemonger over 11 years
      "Hey, I've got an idea: let's take one of the most basic user-computer interactions that's been around since the early 1980s, and break it completely! If it's shiny enough nobody will mind!" -- Sorry, but there's something fundamentally wrong with changing vertical scrolling into horizontal scrolling halfway through the page.
    • Orbling
      Orbling over 11 years
      Essentially just doing both at once when you arrive at the right place.
    • Dancer
      Dancer over 11 years
      cheers guys, I've just gotta do what the client wants! But this is a pain in the ass to figure out - any thoughts/suggestions on how to achieve would be most welcome!
    • Asciiom
      Asciiom over 11 years
      Basically, it DOESN'T scroll horizontally, it fakes this by mapping the scroll value to the element's horizontal positioning.
    • rexmac
      rexmac over 11 years
      The (alleged) author of that site talks a bit about how it works here.
    • DBUK
      DBUK over 11 years
      This question really interests me. I have been thinking about the same thing and all I can find is hori or vert...but never together in the same site. The closest I could find was: blog.fraser-hart.co.uk/jquery-sprite-animation/#.UE3GGHmoxvk
    • Dancer
      Dancer over 11 years
      check out scrollorama - its a bit confusing to setup - but works a treat..johnpolacek.github.com/scrollorama
    • Joram van den Boezem
      Joram van den Boezem over 11 years
      Not an answer but worth checking out while at unorthodox scrolling effects: 360langstrasse.sf.tv
    • Louis Ricci
      Louis Ricci over 11 years
      @DBUK - if you're interested in the algorithm behind the effect. I implemented it (with the four directions) in a jsfiddle. (check my answer)
  • Dancer
    Dancer over 11 years
    Scrollorama is great and will do the job I think, bit confusing to get my head around as the documentation is pretty sparse - but looks like it will do the trick with som effort..
  • Dancer
    Dancer over 11 years
    spoke too soon! doesnt support multi direction parallax
  • NicMagnier
    NicMagnier over 11 years
    Do you mean the user will be able to scroll vertically and horizontally navigate the content?
  • Dancer
    Dancer over 11 years
    no they need to scroll in the one direction (down) and at a certain point the parallax needs to go right to left despite the fact they are still scrolling down.. they want something almost exactly the same as victoriabeckham.landrover.com/INT
  • NicMagnier
    NicMagnier over 11 years
    I still didn't had time to have a close look at scrollorama but I thought it was possible to move elements left and right. I did a quick test here: mx981.com/stuff/scrollrama/test.html
  • Dancer
    Dancer over 11 years
    Cheers Nic, I'd need to use Superscrollorama though as i'd need the combined pinning/ parallax effects - I cant for the life of me get the script above to work in a pinned superscrollorama syntax - if you could explain that the +100 bounty is yours!
  • NicMagnier
    NicMagnier over 11 years
    I'd love to help but this week will be tough. If I find some time I'll try to tinker with it.
  • Louis Ricci
    Louis Ricci over 11 years
    @DBUK - For simple effects like this I prefer rolling my own code. Plugins have there place, but we're talking ~150 lines of JavaScript. IMHO you can learn more from my thrown together example than you can from an all encompassing jQuery plugin like Scrollrama.
  • DBUK
    DBUK over 11 years
    Sadly I am not up to rolling my own code yet, soon hopefully, but from looking at your js I have a better grasp/understanding of it than I do with scrollrama etc, thanks again :)
  • Raja
    Raja almost 11 years
    Thanks for the great script. If i want to control the scroll speed, then where should i change on the script?. Suggest Please.
  • Louis Ricci
    Louis Ricci almost 11 years
    @Yadheendran - The calls to "parallaxScroll(NUM_OF_PIXELS_TO_SCROLL)" take a parameter, if you increase the magnitude of the parameter it will scroll faster. You could also decrease the interval time on the "window.setInterval".