Giter Club home page Giter Club logo

Comments (5)

harm-less avatar harm-less commented on August 14, 2024

Can you give a small example of what you mean? Could be a demo, sample code or documentation.

from angular-sticky.

psaniko avatar psaniko commented on August 14, 2024

I found it hard to write pseudo code for our use case, so I'll try to explain. On desktop the scroll event is fired multiple times during scrolling as expected. On mobile touch devices though, the scroll event is only fired when the scrolling is complete, that is you remove the finger from the screen and momentum scrolling has stopped. This results in a rather long delay for updating the stickyness.

Firing events during momentum scrolling is whole different topic but at least for moving the page there are the touchmove events which the plugin could listen to in addition to scroll events.

Demo for touchmove here: http://tomicloud.com/2012/03/multi-touch-demo

As an alternative way, maybe there could be an option to trigger an update of the sticky elements? I found the draw() method but I am not sure if this would be the right place.

from angular-sticky.

harm-less avatar harm-less commented on August 14, 2024

I understand now and also you make a good point that made me realize something. You can use the draw method in order to bind you own touch events whatever that looks like.

I think from this demo it will become apparent what I mean. You then can bind other events than scroll that will call the draw method. The only downside is that you can no longer use the hl-sticky directive, but the result is the same.

from angular-sticky.

psaniko avatar psaniko commented on August 14, 2024

Alright, we'll use the draw method then, thanks. Maybe custom callbacks on the h1-sticky directive can be put on the someday-later-list :)

from angular-sticky.

harm-less avatar harm-less commented on August 14, 2024

Alright, they might be some day.
Perhaps you can show me some example code when you're done with the implementation, because it might inspire me to make features that have those callbacks supported.

from angular-sticky.

Related Issues (20)

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.