Is there a way to delay a button element from appearing on a certain page until 10 seconds after the page has loaded?
Hi alex5252!
Thank you for using Enfold.
Yes, that’s possible. Try to turn on the custom css class field first. Refer to this link:http://kriesi.at/documentation/enfold/turn-on-custom-css-field-for-all-alb-elements/
Edit a button element, add a custom css class attribute. Use “custom-button” for example. Add this in the function.php file:
add_action('wp_footer', 'ava_custom_script', 10);
function ava_custom_script(){
?>
<script>
(function($) {
$(window).load(function() {
setTimeout(function() {
$('.custom-button').css({'opacity' : 1});
}, 5000);
});
}(jQuery));
</script>
<?php
}
After that, use this in the Quick CSS field:
.custom-button {
opacity: 0;
}
The button will show 5 seconds after page load.
Best regards,
Ismael
Hi Ismael,
is it possible to load even after 10 minutes?
Hey!
Yes you can replace 5000 in the code with any other value. 5000 equals 5000 milliseconds or 5 seconds. 10 minutes are 600 seconds or 600000 milliseconds. If you replace 5000 with 600000 it should do the trick.
Best regards,
Peter