Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML5 / Javascript Parallax Effect on single elements / div tags?

I have created a few sites in the past with the scrolldeck.js that have the standard full screen background with one layer ontop and text (the standard scroll parallax style) this is not what I am looking for.

Im looking for a script or tutorial (or examples) for having a single div tag (image) in the foreground animate/move as you scroll. I will be using this on a one page vertical scrolling site, so as your scrolling I would like the odd image to scroll in at a different speed and have a start and stop position. I dont want the entire background on parallax.

Thanks a bunch in advance


EDIT: Here is a better explanation of what Im looking for:

Picture scrolling down a page, as you scroll you see a bottle thats floating (transparent png), you continue to scroll down reading content and at a certain point that bottle rests nicely on a table (part of background) as you keep scrolling it will no longer move.

Pretty well the goal is to have elements (images) move into pre-determined positions (based on scrolling) and then stay put once they get to their final resting position.


EDIT 2: Here are some example sites:
http://jessandruss.us/ - this site does exactly what I want about 2/3 of the way down at this point: see screenshot
http://smokeybones.com/ - the burger pretty well does the effect I want, minimal but it moves into position as you scroll.

like image 657
matt Avatar asked Aug 17 '12 15:08

matt


3 Answers

http://prinzhorn.github.com/skrollr/

This library is a native javascript (no need for jQuery etc.) parallax scrolling plugin. The plugin homepage has an actual demo of what you are looking for. Github repo is here.

like image 130
Kostia Avatar answered Nov 15 '22 00:11

Kostia


Based on your comment but hopefully at a different pace then the actual page scrolls creating a parallax effect. - I tried to simulate that effect.

Basically, the moving object travels at the same rate at which the page scrolls but covers a different distance proportional to the viewport (visible area)

DEMO here.

Note: Use the scrollbar handle instead of the mouse wheel.

like image 43
Robin Maben Avatar answered Nov 15 '22 00:11

Robin Maben


you should look at the source of https://victoriabeckham.landrover.com/INT basically ther's a 'player' that handles some css properties that gives the parallax effect that you want to achieve; mainly is't matter of background-position alla the elements that should have such treatment are into a

like image 1
user1555320 Avatar answered Nov 14 '22 23:11

user1555320