Jump to content

Search the Community

Showing results for tags 'Count Down timer'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 1 result

  1. Hello every one, today I created the count down timer , but I want to make using OOP style this time. the place where I stuck, is the setTimeout method can't call my class/function every 1000 miliseconds. Please I need your help, where I mess things up? Your help is highy appreciate, Thank you. Bellow is my code. <script type="text/javascript"> window.onload = function(){ function ticTock(ddt){ this.currentDate =new Date(); this.dueDate = new Date(ddt); this.diffDate = this.dueDate.getTime()-this.currentDate.getTime(); if(this.diffDate<=0){ clearTimeout(timer); document.write("closed") } this.seconds = Math.floor(this.diffDate/1000); this.minutes = Math.floor(this.seconds/60); this.hours = Math.floor(this.minutes/60); this.days = Math.floor(this.hours/24); this.hours %=24,this.minutes %=60,this.seconds%=60; this.remainder = this.days+'|'+this.hours+"|"+this.minutes+"|"+this.seconds; var timer = setTimeout(function(){ ticTock(ddt); },1000); } dueDate = "December 25, 2017 00:01:00"; dueDate2 = "December 25, 2019 00:01:00"; var obj = new ticTock(dueDate); var obj2 = new ticTock(dueDate2); document.body.innerHTML = obj.seconds; } </script>
×
×
  • Create New...