-
AuthorPosts
-
October 29, 2019 at 5:28 pm #1152102
On our website, we want to use animations in the last color section. The other animations are all triggering in time but this single one does not.
It seems like animations will start only if you scroll past 50% of the section. Since this is the end of the page, there is just not enough space to scroll further, hence, the animation will not trigger.I’ve attached the URL in the private section.
Thanks,
David- This topic was modified 5 years, 1 month ago by maucherOnline.
November 1, 2019 at 5:58 pm #1153110Hey HITFighter,
Thank you for the inquiry.
It seems like animations will start only if you scroll past 50% of the section.
Yes, that is correct. The waypoint script handles the execution of the animation on scroll. If you want to adjust the offset value so that the animation triggers once the element is visible in the view port, please edit the js > shortcodes.js file and look for the activate_waypoints function around line 217. Set the offset value from “80%” and “95%” to “-50%” so that the animation triggers when the element is visible at the bottom of the screen.
Best regards,
IsmaelNovember 5, 2019 at 4:50 pm #1154024Hey Ismael,
thanks for your help.
Since I cannot simply overwrite the parent theme, I copy/pasted the code from shortcodes.js into an Enfold code element and appended it to the pages with the problematic last section.
I also tested your solution in the original file but it’s still the same problem when I apply it to shortcode.js. That change however, I reverted.
EDIT: the problem is only reproducable on Chrome
Could you please have a look again?Thanks,
David- This reply was modified 5 years, 1 month ago by maucherOnline.
November 8, 2019 at 5:55 am #1154846Hi,
Sorry for the delay. Did you toggle the Performance > File Compression settings after doing the modification? This should regenerate the scripts and stylesheets and ensure that the changes are applied to the site immediately. And please don’t forget to purge the cache and remove the browser history before checking the page again.
Best regards,
IsmaelDecember 9, 2019 at 1:40 pm #1164031you can use the implemented waypoint script but have your own settings with child-theme functions.php.
for some enfold animations it is only necessary to have fired it once the point of triggering is passed. But sometimes it is nice to include if scroll-direction is important:
f.e. if you like to move a container from off-screen to the center – and on scrolling up it will go off-screen againfor that i use to toggle a class to which i can give the animation rules. The element to observe gets a custom class ( f.e. inview )
function scroll_up_down_change() { ?> <script> (function($) { var element_to_animate = $('.inview'); element_to_animate1.waypoint(function(direction) { if (direction === 'down') { $(this.element).addClass('animate-now'); } },{offset: '90%'} ); element_to_animate1.waypoint(function(direction) { if (direction === 'up') { $(this.element).toggleClass('animate-now'); } },{offset: '90%'} ); })(jQuery); </script> <?php } add_action('wp_footer', 'scroll_up_down_change', 9999);
then you can play with offset too.
By the way i believe the 100% offset is if it comes on the bottom into view – so maybe the 90% will do the trick on the change aboveSee here the last button on that page uses 90% : https://webers-testseite.de/buttons/
and an enfold animation – but you can have your own keyframes aswell – just define it for the toggled class.
Or: See here how it can be used to change header_bg background-color on color-section dependencies.: https://kriesi.at/support/topic/menu-bar-with-dynamically-changing-colors-referencing-the-background/#post-1161520December 9, 2019 at 9:58 pm #1164206Hi,
Thank you for sharing this! :)
Best regards,
Basilis -
AuthorPosts
- You must be logged in to reply to this topic.