Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #471815

    Is there a way to delay a button element from appearing on a certain page until 10 seconds after the page has loaded?

    #472228

    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

    #980759

    Hi Ismael,

    is it possible to load even after 10 minutes?

    #980761

    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

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.