somewebmedia / hc-sticky

JavaScript library that makes any element on your page visible while you scroll.
https://somewebmedia.github.io/hc-sticky/
MIT License
463 stars 115 forks source link

Smooth transition on Update Offset? #73

Closed steve231293 closed 3 years ago

steve231293 commented 3 years ago

Hello there,

Could you make smooth transition for sticky elements when update "offset" setting?

somewebmedia commented 3 years ago

I'm not sure I follow. Can you give me an exact example of the desired behaviour?

steve231293 commented 3 years ago

Hello @somewebmedia

For eg:

When I scroll up then I want to show sticky header, now I need to update offset top. Everything is ok now. But there is no transition for top. I know CSS transition not working with top maybe use CSS translateY instead of?

somewebmedia commented 3 years ago

Ah, I see. It's not possible with this lib. It's using position absolute and top property, so it would have to be animated, which would add an extra complexity to it which I don't think could be done because the lib is already complex by itself. Sorry.

steve231293 commented 3 years ago

Oki, thank you for your quick reply.