This topic has 2 replies, 2 voices, and was last updated 9 years by newemery.

  • Author
  • #94829
     newemery
    Participant

    i will publish my site soon, i want to make my home page with a date and counting it down.

    i just found an animated number, i need it related with the actual date.

    days, hours, minutes, second.

    #94847
     sharmstr
    Moderator

    That’s an animated number counter, not a date counter. There are many plugins out there that will do this.

    https://wordpress.org/plugins/tags/countdown

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #94864
     newemery
    Participant

    ok, thanks alot,

    i found another solution with custom JavaScript code and if you found anyone asking the same question.

    pls reply with this code in custom javascript field

    <script>

    CountDownTimer(‘6/30/2016 10:1 AM’, ‘countdown’);
    CountDownTimer(’06/30/2016 10:1 AM’, ‘newcountdown’);

    function CountDownTimer(dt, id)
    {
    var end = new Date(dt);

    var _second = 1000;
    var _minute = _second * 60;
    var _hour = _minute * 60;
    var _day = _hour * 24;
    var timer;

    function showRemaining() {
    var now = new Date();
    var distance = end – now;
    if (distance < 0) {

    clearInterval(timer);
    document.getElementById(id).innerHTML = ‘EXPIRED!’;

    return;
    }
    var days = Math.floor(distance / _day);
    var hours = Math.floor((distance % _day) / _hour);
    var minutes = Math.floor((distance % _hour) / _minute);
    var seconds = Math.floor((distance % _minute) / _second);

    document.getElementById(id).innerHTML = ‘<div class=”count-style”>’+days +'<br><br>’+ ‘أيام </div>’;
    document.getElementById(id).innerHTML += ‘<div class=”count-style”>’+ hours +'<br><br>’+ ‘ساعات </div>’;
    document.getElementById(id).innerHTML += ‘<div class=”count-style”>’+ minutes +'<br><br>’+ ‘دقائق </div>’;
    document.getElementById(id).innerHTML += ‘<div class=”count-style”>’+ seconds +'<br><br>’+ ‘ثوانى </div>’;
    }

    timer = setInterval(showRemaining, 1000);
    }

    </script>

    and this code in css file

    .count-style{
    background: repeating-radial-gradient( circle at 0 0, #eee, #ccc 50px );
    margin-left:10px;
    padding-top:55px;
    border:2px solid #c7c7c7;
    width:23.5%;
    height:200px;
    float:right;}

    and this code in the html page
    <div id=”countdown”></div>

Viewing 3 posts - 1 through 3 (of 3 total)

The forum ‘General questions’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?