Lilly
Lilly

Reputation: 69

Reverse scrolling with HTML5

Is it possible to create a reverse scrolling effect with HTML5 and JavaScript on two parts of the screen, something like this? http://nationallgbtmuseum.org/#/home/

Upvotes: 0

Views: 540

Answers (1)

Gyula Sz.
Gyula Sz.

Reputation: 212

You can override scrolling with jQuery. Simple like this:

​$(window).scroll(function() {
// TODO scrolling
});​​

If you want to create a page like you linked, you need two main section on your page. A left and a right side. While the left content is normally scrolled, you reverse the content of the right section, and every time when the window scrolled you need to get the offset-from top. After that you set the top position of the right section. Here is the example: http://jsfiddle.net/338R8/25/

Upvotes: 5

Related Questions