Code Monkey home page Code Monkey logo

jquery-scrollsnap-plugin's People

Contributors

azaslavsky avatar benoitpointet avatar crunc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

jquery-scrollsnap-plugin's Issues

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

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.

Add PageUP and PageDown support.

Is there any way to do this? Go to the next snap when PAGE Down is pressed and previous with PAGE UP. If you imagine a post with 12 pictures, it would be just perfect to and effortless browse through with this. Please consider this in an update.

Also, any way to temporarily pause the script when the mouse clicks and scrolls on the scrollbar? It still tries to "snap" when you scroll.

Thanks for a great script.

Making it less fritzy

I didn't know how to surmise for the title - I apologise!

Scrolling breathing room so it doesn't attempt to snap between scrolls. It tries to snap immediately after I've left my fingers! It's crazy.

I had some very large proximities to begin with but it was nuts haha

I'm looking for a way to detect if the user has stopped scrolling for a while and to then initialise the snap.

Great job so far!

Snapping entire DOM window does not work in IE (Workaround available)

When using the scrollingEl.defaultView for snapping the entire DOM window, it fails to snap in IE (verified in version 10 and below) because the browser doesn't understand the 'scrollX' or 'scrollY' properties.

I was able to work around this by modifying the code to check for undefined type of 'scrollX', and if so, use the 'pageXOffset' property instead.

Feel free to merge this code into your project.

var tempOffset;

$(scrollingEl).find(settings.snaps).each(function() {
     tempOffset = (typeof scrollingEl.defaultView['scrollX'] != "undefined") ? 'scroll'+settings.direction.toUpperCase() : 'page' + settings.direction.toUpperCase() + 'Offset'; //Since IE doesn't know what "scrollX" is, then switch to "pageXOffset"
       var snappingEl = this,
       dy = Math.abs(($(snappingEl).offset()[leftOrTop.toLowerCase()] + settings.offset) - scrollingEl.defaultView[tempOffset]);

       ...rest of code...
}

set different snap point for first and last snap element

This feature is great, but if the elements you want to snap aren't until further down the page (say you have 100% height intro div on your site) I don't want it to immediately snap down to the element if a user is on a short browser.

To elaborate:

I have the snap elements 700px tall. I want it to always snap to something when scrolling through these elements, so I set the proximity to half of that (350px). The problem is, if someone is still on the intro div (set to 100% height, above the snap elements) depending on screen size, a little bit of scrolling and the user is immediately taken to the first object.

(I could see this potentially being an issue if the snap elements were taller than 700px, where the snapping happens on page load before the user even scrolls, just because of the proximity to the first snap element)

I have the same issue with the last element, but it would be great if there was a way to detect if the user has scrolled to the bottom, and if so to not do anything with the snapping. Thoughts?

IOS7 issue with bouncing snap

Iphone 4s with IOS7 Beta3 safari gives nasty bouncing loop effect that never stops. hope this is just beta but i think it is something to look for if issue stays.

Add a destroy method

It would be handy with a destroy method. A use case could be to disable snapping for touch devices.

breaks on window resize

hello,
i am using scrollsnap on a series of divs which are each full window height. when the window is resized the div's heights change and scrollsnap starts making the whole page jitter up and down. i looked for a destroy method so i could rebuild scrollsnap on resize but it looked like you decided not to do one.
do you know another workaround?
thank you for the otherwise fantastic piece of code : )
b

bower pulls in old version

The version that is installed when running

bower install jquery-scrollsnap

is not the same as used in the example (http://benoit.pointet.info/stuff/jquery-scrollsnap-plugin/) and that is in the git repository. To get the most up to date version one has to run

bower install jquery-scrollsnap#master

This happened two times to me by now, so I thought I leave a note :)

The fix would maybe be to bump up the version number in the bower.json?

Thanks for this great plugin!

snap on scrollstart

ability to capture the scroll gesture and snap on the next snap in that direction.

Snap on resize

I'm working on a site with full window snappable elements and I'm wondering if there's a way to fire off a snap whenever the windows resizes? I thought about just being hacky and making a script that scrolled one pixel on resize so the plugin does it, but I figured there's gotter be a smarter way.

Any help would appreciated. I understand jquery enough to do less smart things like the pixel thing, but not enough to engineer this resize thing myself.

Changing options after initialization

Hi and thanks for a nice plugin!

I'm setting the proximity option to be half the viewport height. I would like to update this on resize. What would be the best way to do so? As far as I can tell, there's no API for this and simply re-initializing the whole plugin doesn't seem to do the trick.

Add "snap to another page whenever scrolling" support

Does anyone know how to change the code to support snapping to the next/previous page whenever the user scrolls to make scrolling easier? the current code needs the user to scroll for more than half of a page to snap to another page.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.