Latest web development tutorials
×

JavaScript & HTML DOM คู่มืออ้างอิง

ภาพรวม

JavaScript วัตถุ

JavaScript Array วัตถุ JavaScript Boolean วัตถุ JavaScript Date วัตถุ JavaScript Math วัตถุ JavaScript Number วัตถุ JavaScript String วัตถุ JavaScript RegExp วัตถุ JavaScript อสังหาริมทรัพย์ทั่วโลก / ฟังก์ชั่น JavaScript ผู้ประกอบการ

Browser วัตถุ

Window วัตถุ Navigator วัตถุ Screen วัตถุ History วัตถุ Location วัตถุ

DOM วัตถุ

HTML DOM Document วัตถุ HTML DOM วัตถุธาตุ HTML DOM แอตทริบิวต์วัตถุ HTML DOM วัตถุที่จัดกิจกรรม

HTML วัตถุ

<a> <area> <audio> <base> <blockquote> <body> <button> <canvas> <col> <colgroup> <datalist> <del> <details> <dialog> <embed> <fieldset> <form> <iframe> <frameset > <img> <ins> <input> - button <input> - checkbox <input> - color <input> - date <input> - datetime <input> - datetime-local <input> - email <input> - file <input> - hidden <input> - image <input> - month <input> - number <input> - range <input> - password <input> - radio <input> - reset <input> - search <input> - submit <input> - text <input> - time <input> - url <input> - week <keygen> <link> <label> <legend> <li> <map> <menu> <menuItem> <meta> <meter> <object> <ol> <optgroup> <option> <param> <progress> <q> <script> <select> <source> <style> <table> <td> <th> <tr> <textarea> <title> <time> <track> <video>

หน้าต่าง clearTimeout () วิธีการ

อ้างอิงวัตถุหน้าต่าง วัตถุหน้าต่าง

ความหมายและการใช้งาน

clearTimeout () วิธีการยกเลิก () ที่ setTimeout การตั้งค่าหมดเวลาวิธีการ

พารามิเตอร์ clearTimeout () วิธีการจะต้องมีค่า ID ที่ส่งกลับโดย setTimeout ()

ไวยากรณ์

clearTimeout(id_of_settimeout)


สนับสนุนเบราว์เซอร์

Internet ExplorerFirefoxOperaGoogle ChromeSafari

เบราว์เซอร์ที่สำคัญทั้งหมดสนับสนุน clearTimeout () วิธีการ


ตัวอย่าง

ตัวอย่าง

ตัวอย่างต่อไปนี้มีการ "เริ่มต้นนับ!" ปุ่มเพื่อเริ่มการจับเวลา, ช่องใส่คุณก็จะนับและปุ่มเพื่อหยุดการจับเวลา "หยุดนับ!":

var c=0;
var t;
var timer_is_on=0;
function timedCount(){
    document.getElementById('txt').value=c;
    c=c+1;
    t=setTimeout(function(){timedCount()},1000);
}
function doTimer(){
    if (!timer_is_on){
        timer_is_on=1;
        timedCount();
    }
}
function stopCount(){
    clearTimeout(t);
    timer_is_on=0;
}

ลอง»


อ้างอิงวัตถุหน้าต่าง วัตถุหน้าต่าง