nckprsn / scrollme

A jQuery plugin for adding simple scrolling effects to web pages.
1.47k stars 318 forks source link

Using data-translatex causes page width to increase #1

Closed tasti closed 10 years ago

tasti commented 10 years ago

I have page with 100% width (I shouldn't be able to scroll horizontally). When animating with data-translatex, the element is outside the bounds of the width and causes the page's width to increase (now scrollable horizontally).

nckprsn commented 10 years ago

Scrollme just handles the changing of CSS properties on the designated elements - it's up to you to account for this in your CSS.

In your case you will need to add overflow:hidden; to any of the "animateme" element's ancestor elements that spans the full width of the viewport. I wouldn't advise doing this on the body element as this may interfere with scrolling. If you don't have any elements in your DOM that fit the criteria you could add a wrapper element around everything use that instead.

Hope that helps - I should probably add something to the docs to make this clear.

tasti commented 10 years ago

That worked, thanks!