jquery-scrollsnap-plugin icon indicating copy to clipboard operation
jquery-scrollsnap-plugin copied to clipboard

Set relative value for proximity and/or change it on resize

Open herzinger opened this issue 11 years ago • 2 comments

I would like to be able to set the proximity option to a value relative to the viewport height, and to reset it after the initial setup. My case use: a responsive layout where in big screens each panel fills the entire viewport, but not in smaller ones, leaving some scrolling area. It would be specially useful in dealing with device orientation changes.

herzinger avatar Oct 02 '14 20:10 herzinger

Did you try to set i to 2000? Should do the job.

Am Donnerstag, 2. Oktober 2014 schrieb Henrique Erzinger :

I would like to be able to set the proximity option to a value relative to the viewport height, and to reset it after the initial setup. My case use: a responsive layout where in big screens each panel fills the entire viewport, but not in smaller ones, leaving some scrolling area. It would be specially useful in dealing with device orientation changes.

— Reply to this email directly or view it on GitHub https://github.com/benoitpointet/jquery-scrollsnap-plugin/issues/26.

Liip FR +41 26 422 2511 http://liip.ch

benoitpointet avatar Oct 02 '14 20:10 benoitpointet

Yes, it works wonders whenever the section is the same height as the viewport, but when it's bigger I want to be able to let the user scroll inside it to see the complete content, without jumping to the next section. It would be nice to be able to calc the ideal proximity on the fly, during the resize event.

Writing this reply, I had one idea that I want to test of a way to achieve something similar to that effect, independently of the plugin, but it is quite ugly and not exactly ideal: To make another container inside the section, with the same dimensions and overflow hidden, so that the user will scroll this one first, and the window will only scroll when this container reaches the end...

herzinger avatar Oct 03 '14 17:10 herzinger