Closed jerepaajanen closed 8 years ago
Can you please share your code/jsfiddle?
This is what I have tried. There's no difference if I add "in", "out", or "bottom" in data-kui-position.
<div class="grid__column u-width-sm-auto" data-kui-anim="fadeInUp" data-kui-position="bottom">...</div>
cool yeah you are using it correctly but can you please share a jsfiddle so I can inspect what the problem is?
I'm trying to use it here: http://rae.fi/client/netmedi/wordpress/kaikuhealth/cancer-care/for-patients/
Cool, thanks @jerepaajanen. it seems like an issue, I will work on it and get back to you.
I tried the new version. Now API call for position work except "bottom" and "top". Position data-attributes doesn't seem to work.
cool @jerepaajanen, I haven't added any options to define the trigger position using data-kui-position
but I'm going to add this now. seems like a good feature!
I meant, data-kui-anim only triggers when the element is in the viewport
just added data-kui-event
so you can define the event name as well. e.g.:
<div data-kui-anim="fadeIn" data-kui-event="top">
Thanks so much for this! Some questions and maybe something to consider for future updates: Is "bottom" same as "in", or are there any differences? Is there a way to show element when it's only half in viewport or "in" + some offset value in px?
re bottom/in: yeah so basically bottom
triggers when element.bottom == window.height
and top
triggers when element.top == 0
.
re padding: kissui.position has this option (you can add a padding to trigger the event, e.g. top + 30px) but I haven't integrated it with the kissui.scrollanim. feel free to make a PR :)
I have tried "data-kui-position", but it doesn't seem to do a thing. Is there a way to animate element when it's at bottom of viewport, or just 10% visible, and not fully in view?