i am trying a sticky card effect within a query loop. for some reason, if within a query, i cannot get cards to become sticky. despite setting container containing query, or even the query template div as relative, the cards will not stick
is that a normal behaviour or am i missing something?
Did you set the top property, like top: 5rem ?
Also check if there is the overflow property applied to any of the parent elements of your query template block, like the query or section block, etc.
Overflow (hidden, scroll, auto) doesn’t work with position: sticky.
Can you elaborate? Not sure if I get this correctly.
Can you give me an example? What is the value of the top property for your first item, then 2nd and 3rd? Just to make sure I get your idea.
The smartest thing would probably be a sass loop.
yes say. process-card (1st one) starts at top 4rem
then the next will come up and stop 2rem below (so would be at 6rem)
then 8rem next one. ive implemented this before
Please remember i have absolutely no idea where to insert (im still having issues understanding relative styling) so a screenshot would be most helpful where to put and what to name please?
its my first build . im loving it, and some places im getting stuck as i dont know it well enough
Could you please try this code on your query template block and let me know what’s it doing on your end?
It’s not the most elegant and efficient way to write this, but I tried to make it readable and understandable.
Creating individual Relative Styles for each child wouldn’t make any sense in my opinion, so I chose the custom code route which is easier maintainable.
thats working perfect
thanks so much, and i would have had NO idea about this. i really thought simple css would have done , but no idea why it wouldnt stick.
This is workign now
i still dont know why we need to use .cc-query-item and not the targeted sp-process class though. that logic i cant understand
thanks @Marius