[Support request] Show button in Generateblocks time-controlled

Home Forums Support Show button in Generateblocks time-controlled

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

    Hello GeneratePress Team,

    Is there a possibility to fade in a button in Generateblocks time-controlled, e.g. after 10 seconds?

    Thank you very much for an answer

    Frank

    #1381178
    David
    Staff
    Customer Support

    Hi there,

    it is possible with Javascript.
    Add this JS to the wp_footer hook:

    <script>
    window.onload = function() {
        document.getElementById('fade-in-button').className = 'active';
    };
    </script>

    And add this CSS to the site:

    #fade-in-button {
        opacity: 0;
        transition: opacity 0.2s ease-in;
        transition-delay: opacity 5s;
    }
    #fade-in-button.active {
        opacity: 1;
    }

    Then give your button an ID of fade-in-button

    The only problem is if a user has JS disabled in their browser the button may never appear.
    There is ways around that but it would involve the button being visible to begin with.

    #1381297
    fn17

    Many Thanks David

    #1381472
    David
    Staff
    Customer Support
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.