Forum Replies Created

Viewing 1 post (of 1 total)
  • Author
  • in reply to: date counter down #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 1 post (of 1 total)

Log in with your credentials

Forgot your details?