
-
AuthorPosts
-
February 26, 2022 at 11:07 am #1342351
Hello and thank you for your help,
I would like to know how to add animation (for example: appear from the left, or the right) to elements on a page?
thank you very much!
February 26, 2022 at 10:27 pm #1342424Hey VirtuHouse,
This can be done with Keyframe Animations this article is pretty good but if you search Google I’m sure you will find more examples. In the example below I created a page with two text blocks, one has left text alignment and the other right, in the custom classes for each element I used either text-box-left or text-box-right
then I used this css:@keyframes slide-in-left { from { transform: translateX(-100%); } to { transform: translateX(0%); } } @keyframes slide-in-right { from { transform: translateX(100%); } to { transform: translateX(0%); } } .text-box-right { animation: slide-in-right 1000ms; } .text-box-left { animation: slide-in-left 1000ms; }
and now on page load the text slides in
this basic example can be applied to other elements, or you can search for more advanced examples, but this should help you get started.Best regards,
MikeFebruary 27, 2022 at 9:27 pm #1342494Sometimes these keyframe animations starts when an eventlistner is fired. One of these events is when an element appears in the viewport, or a certain scroll distance has been completed. Sometimes there are little tools in themes that observe whether an element appears in the viewport or not.
Thus, Enfold is embedded a script that can perform such tasks. ( keyword is: waypoint script ).
You can see it in shortcodes.js file on line 232ff
and the helper function itself is on line 705ffFebruary 27, 2022 at 11:04 pm #1342496Hi,
Thank you Guenni007 this is a good point.
So to expand on the above example to trigger the animation when the element is in view and not just on page load, we will add the class avia_animate_when_visible to the custom class with a space after the text-box-left or text-box-right classes
and changed the css to this:@keyframes slide-in-left { from { transform: translateX(-100%); } to { transform: translateX(0%); } } @keyframes slide-in-right { from { transform: translateX(100%); } to { transform: translateX(0%); } } .text-box-right.avia_start_animation { animation: slide-in-right 1000ms; } .text-box-left.avia_start_animation { animation: slide-in-left 1000ms; }
note the avia_start_animation class in the css, the waypoint script that Guenni007 pointed out changes the avia_animate_when_visible class to avia_start_animation so the css will work.
Best regards,
MikeFebruary 28, 2022 at 10:25 am #1342520thank you very much! It works.
Is there a list of animation I can use?
For example, if I want some element appears like the elements of the timeline (is it the fadein animation?)Do I have to add that class: avia_start_delayed_animation.fade-in ?
-
This reply was modified 3 years, 1 month ago by
VirtuHouse.
February 28, 2022 at 1:30 pm #1342555you can look inside the shortcodes.css file form lines 663ff
those classes:
fade-in , pop-up , top-to-bottom , bottom-to-top , left-to-right , right-to-left , av-rotateIn , av-rotateInUpLeft , av-rotateInUpRight
the keyframe names are under those classes …
_____
yes – but on the classes input field classes that are on the same elment are added by only ohne space between without dots.
you can see it on mikes first image above:
https://kriesi.at/support/topic/animation-on-element/#post-1342496February 28, 2022 at 1:38 pm #1342556Hi,
There is a partial list of animation classes in our documentation , to use the timeline fadein animation that will also use the waypoint, so it will trigger when the element in view, you would use these classes with no dots and separated with a space, like this:
avia_animate_when_visible fade-in av-animated-generic
the avia_start_delayed_animation class starts the animation on page load and doesn’t wait for the element to be in view, so it depends on when you want the animation to be triggered.Best regards,
Mike -
This reply was modified 3 years, 1 month ago by
-
AuthorPosts
- You must be logged in to reply to this topic.