• Resolved imsaim

    (@imsaim)


    Hy there
    Is there any chance we can keep the user wait to show up the download button.
    I tried using this script in footer.php file by replacing id but not working.

    <script>
    var downloadButton = document.getElementById(“download”);
    var counter = 10;
    var newElement = document.createElement(“p”);
    newElement.innerHTML = “You can download the file in 10 seconds.”;
    var id;
    downloadButton.parentNode.replaceChild(newElement, downloadButton);
    id = setInterval(function() {
    counter–;
    if(counter < 0) {
    newElement.parentNode.replaceChild(downloadButton, newElement);
    clearInterval(id);
    } else {
    newElement.innerHTML = “You can download the file in ” + counter.toString() + ” seconds.”;
    }}, 1000);
    </script>

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Bas Schuiling

    (@basszje)

    Hi,

    The button is just a piece of HTML when put on a page, so you can target it with any scripting you like.

    It’s probably easier to name the button and target the button name with a piece of jQuery instead of vanilla javascript.

    Also maybe just hide the button instead of replacing DOM objects.

    Thread Starter imsaim

    (@imsaim)

    Thanks for the reply.
    Can you please suggest me any web resource doing this?

    I tried finding some way but couldn’t find any for the max button.

    Or explain it here whenever you get time, It will be more effective for the new users as well who are finding this topic.

    • This reply was modified 4 years, 12 months ago by imsaim.
    Plugin Author Bas Schuiling

    (@basszje)

    Hi,

    I can’t really. This is web developer territory, not something our plugin does.

    When I google for wordpress plugins with timed content / timers and such I can find a few that might be able to do what you want. You can try.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Download Timer’ is closed to new replies.