婷婷综合国产,91蜜桃婷婷狠狠久久综合9色 ,九九九九九精品,国产综合av

主頁 > 知識庫 > HTML5計時器小例子

HTML5計時器小例子

熱門標簽:小朱地圖標注 百度地圖標注為什么總是封號 400開頭的電話好申請不 怎么做百度地圖標注 四川移動電銷外呼客戶管理系統 智能芯電話機器人 地圖標注柱狀圖 咸陽穩定外呼系統軟件 臨海地圖標注app
html:

復制代碼
代碼如下:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<!-- Always force latest IE rendering engine (even in intranet) & Chrome Frame
Remove this if you use the .htaccess -->
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>HTML5 Timer for work-relax balance</title>
<meta name="description" content="">
<meta name="author" content="kevin">
<meta name="viewport" content="width=device-width; initial-scale=1.0">
<!-- Replace favicon.ico & apple-touch-icon.png in the root of your domain and delete these references -->
<link rel="shortcut icon" href="/favicon.ico"/>
<link rel="apple-touch-icon" href="/apple-touch-icon.png"/>
<link rel="stylesheet" type="text/css" href="css/style.css">
<script>
countDownSeconds = 60;
var handle = null;
//window load
function onLoadWindow() {
aCanvas = document.getElementById("countdownCanvas");
context = aCanvas.getContext("2d");
var canvasText = "Press to Start...";
var xPos = aCanvas.width / 2;
var yPos = aCanvas.height / 2;
context.font = "12pt Century Gothic";
context.fillStyle = "#008000;";
context.textAlign = "center";
context.textBaseline = "middle";
context.fillText(canvasText, xPos, yPos);
}
function updateCanvas(theContext, width, height) {
if (countDownSeconds < 0) {
clearInterval(handle);
handle = null;
alert("hey, time is up!");
return 0;
}
minStr = Math.floor(countDownSeconds / 60);
secStr = countDownSeconds % 60;
if (minStr < 10) {
minStr = "0" + minStr;
}
if (secStr < 10) {
secStr = "0" + secStr;
}
context.clearRect(0, 0, width, height);
context.font = "24pt Century Gothic";
context.fillText(minStr + " : " + secStr, width / 2, height / 2);
countDownSeconds--;
}
function startWorkCountDown() {
if (handle != null) {
clearInterval(handle);
}
countDownSeconds = document.getElementById("workIntervalInput").value * 60;
timeDisplayCanvas = document.getElementById("countdownCanvas");
timeDisplayContext2D = timeDisplayCanvas.getContext("2d");
updateCanvas(timeDisplayContext2D, timeDisplayCanvas.width, timeDisplayCanvas.height);
handle = setInterval(function() {
updateCanvas(timeDisplayContext2D, timeDisplayCanvas.width, timeDisplayCanvas.height);
}, 1000);
}
function startRestCountDown() {
if (handle != null) {
clearInterval(handle);
}
countDownSeconds = document.getElementById("restIntervalInput").value * 60;
timeDisplayCanvas = document.getElementById("countdownCanvas");
timeDisplayContext2D = timeDisplayCanvas.getContext("2d");
updateCanvas(timeDisplayContext2D, timeDisplayCanvas.width, timeDisplayCanvas.height);
handle = setInterval(function() {
updateCanvas(timeDisplayContext2D, timeDisplayCanvas.width, timeDisplayCanvas.height);
}, 1000);
}
</script>
</head>
<body onload="onLoadWindow()">
<div align="center">
<header>
<h1>work-life balance timer</h1>
</header>
Please choose the work interval:
<input name="workIntervalInput" id="workIntervalInput" type="number" value="25" min="15" max="45" step="5"/>
minutes

Please choose the rest interval:
<input name="restIntervalInput" id="restIntervalInput" type="number" value="5" min="3" max="10" step="1"/>
minutes


<canvas id="countdownCanvas" width="300" height="50" style="border:2px solid black">
This is a canvas
</canvas>


<button onclick="startWorkCountDown()">
Work Hard
</button>
<button onclick="startRestCountDown()">
Take A Break
</button>
<footer>
<p>
&copy; Copyright Reserved
</p>
</footer>
</div>
</body>
</html>

css3:

復制代碼
代碼如下:

/*
* HTML5 ✰ Boilerplate
*
* What follows is the result of much research on cross-browser styling.
* Credit left inline and big thanks to Nicolas Gallagher, Jonathan Neal,
* Kroc Camen, and the H5BP dev community and team.
*
* Detailed information about this CSS: h5bp.com/css
*
* ==|== normalize ==========================================================
*/

/* =============================================================================
HTML5 display definitions
========================================================================== */
article, aside, details, figcaption, figure, footer, header, hgroup, nav, section { display: block; }
header {text-shadow: #220000 0px 0px 10px 10px;}
audio, canvas, video { display: inline-block; *display: inline; *zoom: 1; }
audio:not([controls]) { display: none; }
[hidden] { display: none; }
/* =============================================================================
Base
========================================================================== */
/*
* 1. Correct text resizing oddly in IE6/7 when body font-size is set using em units
* 2. Force vertical scrollbar in non-IE
* 3. Prevent iOS text size adjust on device orientation change, without disabling user zoom: h5bp.com/g
*/
html { font-size: 100%; overflow-y: scroll; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; }
body { margin: 0; font-size: 24px; line-height: 1.231;}
body, button, input, select, textarea {font-family:"Century Gothic"; color:#008000}
/*
* Remove text-shadow in selection highlight: h5bp.com/i
* These selection declarations have to be separate
* Also: hot pink! (or customize the background color to match your design)
*/
::-moz-selection { background: #fe57a1; color: #fff; text-shadow: none; }
::selection { background: #fe57a1; color: #fff; text-shadow: none; }

/* =============================================================================
Links
========================================================================== */
a { color: #00e; }
a:visited { color: #551a8b; }
a:hover { color: #06e; }
a:focus { outline: thin dotted; }
/* Improve readability when focused and hovered in all browsers: h5bp.com/h */
a:hover, a:active { outline: 0; }

/* =============================================================================
Typography
========================================================================== */
abbr[title] { border-bottom: 1px dotted; }
b, strong { font-weight: bold; }
blockquote { margin: 1em 40px; }
dfn { font-style: italic; }
hr { display: block; height: 1px; border: 0; border-top: 1px solid #ccc; margin: 1em 0; padding: 0; }
ins { background: #ff9; color: #000; text-decoration: none; }
mark { background: #ff0; color: #000; font-style: italic; font-weight: bold; }
/* Redeclare monospace font family: h5bp.com/j */
pre, code, kbd, samp { font-family: monospace, monospace; _font-family: 'courier new', monospace; font-size: 1em; }
/* Improve readability of pre-formatted text in all browsers */
pre { white-space: pre; white-space: pre-wrap; word-wrap: break-word; }
q { quotes: none; }
q:before, q:after { content: ""; content: none; }
small { font-size: 85%; }
/* Position subscript and superscript content without affecting line-height: h5bp.com/k */
sub, sup { font-size: 75%; line-height: 0; position: relative; vertical-align: baseline; }
sup { top: -0.5em; }
sub { bottom: -0.25em; }

/* =============================================================================
Lists
========================================================================== */
ul, ol { margin: 1em 0; padding: 0 0 0 40px; }
dd { margin: 0 0 0 40px; }
nav ul, nav ol { list-style: none; list-style-image: none; margin: 0; padding: 0; }

/* =============================================================================
Embedded content
========================================================================== */
/*
* 1. Improve image quality when scaled in IE7: h5bp.com/d
* 2. Remove the gap between images and borders on image containers: h5bp.com/e
*/
img { border: 0; -ms-interpolation-mode: bicubic; vertical-align: middle; }
/*
* Correct overflow not hidden in IE9
*/
svg:not(:root) { overflow: hidden; }

/* =============================================================================
Figures
========================================================================== */
figure { margin: 0; }

/* =============================================================================
Forms
========================================================================== */
form { margin: 0; }
fieldset { border: 0; margin: 0; padding: 0; }
/* Indicate that 'label' will shift focus to the associated form element */
label { cursor: pointer; }
/*
* 1. Correct color not inheriting in IE6/7/8/9
* 2. Correct alignment displayed oddly in IE6/7
*/
legend { border: 0; *margin-left: -7px; padding: 0; }
/*
* 1. Correct font-size not inheriting in all browsers
* 2. Remove margins in FF3/4 S5 Chrome
* 3. Define consistent vertical alignment display in all browsers
*/
button, input, select, textarea { font-size: 100%; margin: 0; vertical-align: baseline; *vertical-align: middle; }
/*
* 1. Define line-height as normal to match FF3/4 (set using !important in the UA stylesheet)
* 2. Correct inner spacing displayed oddly in IE6/7
*/
button, input { line-height: normal; *overflow: visible; }
/*
* Reintroduce inner spacing in 'table' to avoid overlap and whitespace issues in IE6/7
*/
table button, table input { *overflow: auto; }
/*
* 1. Display hand cursor for clickable form elements
* 2. Allow styling of clickable form elements in iOS
*/
button, input[type="button"], input[type="reset"], input[type="submit"] { cursor: pointer; -webkit-appearance: button; }
/*
* Consistent box sizing and appearance
*/
input[type="checkbox"], input[type="radio"] { box-sizing: border-box; }
input[type="search"] { -webkit-appearance: textfield; -moz-box-sizing: content-box; -webkit-box-sizing: content-box; box-sizing: content-box; }
input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; }
/*
* Remove inner padding and border in FF3/4: h5bp.com/l
*/
button::-moz-focus-inner, input::-moz-focus-inner { border: 0; padding: 0; }
/*
* 1. Remove default vertical scrollbar in IE6/7/8/9
* 2. Allow only vertical resizing
*/
textarea { overflow: auto; vertical-align: top; resize: vertical; }
/* Colors for form validity */
input:valid, textarea:valid { }
input:invalid, textarea:invalid { background-color: #f0dddd; }

/* =============================================================================
Tables
========================================================================== */
table { border-collapse: collapse; border-spacing: 0; }
td { vertical-align: top; }

/* ==|== primary styles =====================================================
Author:
========================================================================== */

/* ==|== non-semantic helper classes ========================================
Please define your styles before this section.
========================================================================== */
/* For image replacement */
.ir { display: block; border: 0; text-indent: -999em; overflow: hidden; background-color: transparent; background-repeat: no-repeat; text-align: left; direction: ltr; }
.ir br { display: none; }
/* Hide from both screenreaders and browsers: h5bp.com/u */
.hidden { display: none !important; visibility: hidden; }
/* Hide only visually, but have it available for screenreaders: h5bp.com/v */
.visuallyhidden { border: 0; clip: rect(0 0 0 0); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; }
/* Extends the .visuallyhidden class to allow the element to be focusable when navigated to via the keyboard: h5bp.com/p */
.visuallyhidden.focusable:active, .visuallyhidden.focusable:focus { clip: auto; height: auto; margin: 0; overflow: visible; position: static; width: auto; }
/* Hide visually and from screenreaders, but maintain layout */
.invisible { visibility: hidden; }
/* Contain floats: h5bp.com/q */
.clearfix:before, .clearfix:after { content: ""; display: table; }
.clearfix:after { clear: both; }
.clearfix { zoom: 1; }

/* ==|== media queries ======================================================
PLACEHOLDER Media Queries for Responsive Design.
These override the primary ('mobile first') styles
Modify as content requires.
========================================================================== */
@media only screen and (min-width: 480px) {
/* Style adjustments for viewports 480px and over go here */
}
@media only screen and (min-width: 768px) {
/* Style adjustments for viewports 768px and over go here */
}

/* ==|== print styles =======================================================
Print styles.
Inlined to avoid required HTTP connection: h5bp.com/r
========================================================================== */
@media print {
* { background: transparent !important; color: black !important; text-shadow: none !important; filter:none !important; -ms-filter: none !important; } /* Black prints faster: h5bp.com/s */
a, a:visited { text-decoration: underline; }
a[href]:after { content: " (" attr(href) ")"; }
abbr[title]:after { content: " (" attr(title) ")"; }
.ir a:after, a[href^="javascript:"]:after, a[href^="#"]:after { content: ""; } /* Don't show links for images, or javascript/internal links */
pre, blockquote { border: 1px solid #999; page-break-inside: avoid; }
thead { display: table-header-group; } /* h5bp.com/t */
tr, img { page-break-inside: avoid; }
img { max-width: 100% !important; }
@page { margin: 0.5cm; }
p, h2, h3 { orphans: 3; widows: 3; }
h2, h3 { page-break-after: avoid; }
}
#startTimer{
position:inherit
width:75px;
height:20px;
top:35px;
left:25px;
cursor:pointer
}
#stopTimer{
position:inherit;
width:75px;
height:20px;
top:10px;
left:25px;
cursor:pointer
}
#countdownCanvas{
border-radius:25px;
box-shadow:10px 10px 5px #888888;
}

標簽:公主嶺 黃石 山南 平涼 黃石 陜西 南平 平頂山

巨人網絡通訊聲明:本文標題《HTML5計時器小例子》,本文關鍵詞  HTML5,計時器,小,例子,HTML5,;如發現本文內容存在版權問題,煩請提供相關信息告之我們,我們將及時溝通與處理。本站內容系統采集于網絡,涉及言論、版權與本站無關。
  • 相關文章
  • 下面列出與本文章《HTML5計時器小例子》相關的同類信息!
  • 本頁收集關于HTML5計時器小例子的相關信息資訊供網民參考!
  • 推薦文章
    婷婷综合国产,91蜜桃婷婷狠狠久久综合9色 ,九九九九九精品,国产综合av
    视频一区二区三区中文字幕| 精品一区免费av| 欧美手机在线视频| 一本大道av伊人久久综合| 国产在线一区观看| 国产一区二区视频在线| 麻豆精品视频在线观看免费| 亚洲一区av在线| 国产一区二区三区黄视频| 99这里只有久久精品视频| 欧美日韩在线三区| 久久看人人爽人人| 亚洲欧洲www| 亚洲v日本v欧美v久久精品| 日韩二区三区四区| 国产一区二区女| 在线视频欧美区| 久久久久久久综合狠狠综合| 日韩伦理av电影| 午夜欧美在线一二页| 日本sm残虐另类| 亚洲成人免费看| 1024成人网| 久久精品国产99久久6| 国产 日韩 欧美大片| 欧美精品视频www在线观看| 91丨porny丨户外露出| 在线播放91灌醉迷j高跟美女 | 日本不卡在线视频| 不卡在线观看av| 欧美xfplay| 亚洲在线视频网站| 91在线一区二区| 国产日韩欧美高清| 亚洲最色的网站| jlzzjlzz亚洲日本少妇| 中文字幕国产一区二区| 国产精品99久久久久久久vr | 午夜欧美视频在线观看| 99re这里只有精品首页| 国产日韩一级二级三级| 国产精品伊人色| 久久婷婷久久一区二区三区| 日本一道高清亚洲日美韩| 欧美日本在线视频| 午夜成人在线视频| 欧美亚洲国产bt| 日韩在线一区二区三区| 91捆绑美女网站| 成人黄色电影在线| 亚洲人精品一区| 一本大道综合伊人精品热热| 日韩毛片高清在线播放| 91尤物视频在线观看| 色综合天天综合网国产成人综合天| 久久蜜臀精品av| 激情综合网av| 日韩成人精品视频| 欧美电影精品一区二区| 免费高清不卡av| 精品国产乱码91久久久久久网站| 日本午夜精品视频在线观看| 欧美日本一区二区| 日韩精品午夜视频| 欧美日韩在线电影| 亚洲制服丝袜在线| 麻豆国产欧美日韩综合精品二区| 欧美日韩中文字幕精品| 日本不卡一二三区黄网| 日韩精品一区二区三区视频播放 | 2020国产成人综合网| 蜜臀av性久久久久蜜臀aⅴ| 国产偷国产偷亚洲高清人白洁| 国产成人精品三级| 亚洲欧美色综合| 欧美精品日韩一本| 亚洲一区二区视频| 精品国产人成亚洲区| 99久久免费精品| 亚洲一区在线播放| 欧美精品粉嫩高潮一区二区| 亚洲国产色一区| 欧美日韩精品高清| 成人av在线资源网| 性欧美大战久久久久久久久| www.欧美色图| 裸体一区二区三区| 亚洲精品日韩综合观看成人91| 精品播放一区二区| 在线观看欧美日本| 国内精品写真在线观看| 国产精品美女视频| 欧美一区二区三区白人| 99re这里只有精品首页| 久久99精品一区二区三区三区| 亚洲成精国产精品女| 国产精品资源在线| 91麻豆免费视频| 欧美一区二区啪啪| 亚洲乱码国产乱码精品精的特点| 中文幕一区二区三区久久蜜桃| 亚洲欧洲韩国日本视频| 蜜桃精品视频在线观看| av电影在线观看一区| 欧美日韩成人综合| 久久综合色鬼综合色| 亚洲一区二区三区中文字幕在线| 日本亚洲三级在线| 91精品福利在线| 国产拍揄自揄精品视频麻豆| 调教+趴+乳夹+国产+精品| 99这里只有久久精品视频| 久久婷婷久久一区二区三区| 日韩av电影免费观看高清完整版| 91丨porny丨中文| 国产亚洲午夜高清国产拍精品 | 成人av在线播放网址| 欧美日韩视频第一区| 2024国产精品| 日韩高清在线观看| 欧美在线免费观看亚洲| 国产精品久久久久婷婷| 国产一区二区三区日韩| 日韩精品在线一区| 视频一区视频二区中文字幕| 91国产视频在线观看| 国产精品视频在线看| 国产综合成人久久大片91| 欧美一区二区精品| 日韩国产在线一| 欧美日韩精品久久久| 午夜精品一区二区三区电影天堂 | 成人福利视频在线| 欧美一区二区三区在线电影| 一区二区三区不卡在线观看| 97久久精品人人做人人爽| 亚洲欧洲另类国产综合| 成人av在线播放网址| 中文字幕av免费专区久久| 国产成人av影院| 中文字幕av在线一区二区三区| 极品少妇xxxx精品少妇| 日韩视频一区二区三区在线播放| 青娱乐精品视频在线| 欧美电影免费提供在线观看| 国内一区二区在线| 国产欧美精品一区| 99re这里都是精品| 亚洲va国产va欧美va观看| 欧美精品丝袜中出| 国产一区美女在线| 国产精品毛片高清在线完整版| 99视频一区二区| 国产精品久久久久永久免费观看 | 亚洲欧美另类综合偷拍| 在线一区二区三区做爰视频网站| 一区二区三区四区在线免费观看| 欧美性色黄大片| 美国欧美日韩国产在线播放| 精品福利在线导航| 91在线观看地址| 午夜视频在线观看一区| 精品对白一区国产伦| www.一区二区| 五月天中文字幕一区二区| 亚洲精品在线免费观看视频| 99久久伊人网影院| 亚洲成人精品一区| 精品入口麻豆88视频| av激情综合网| 六月婷婷色综合| 亚洲女同女同女同女同女同69| 日韩视频在线一区二区| 99久久国产综合色|国产精品| 视频在线在亚洲| 国产精品毛片无遮挡高清| 91精品国产综合久久久久| 成人午夜精品一区二区三区| 日韩国产欧美在线视频| 综合久久国产九一剧情麻豆| 日韩一区二区在线播放| 99re视频精品| 韩国成人在线视频| 天堂成人国产精品一区| 亚洲欧美影音先锋| 欧美大黄免费观看| 91色九色蝌蚪| 国产又黄又大久久| 香蕉久久夜色精品国产使用方法| 久久色在线观看| 69av一区二区三区| 成人黄色综合网站| 麻豆一区二区99久久久久| 亚洲激情图片一区| 欧美精品日韩精品| 91视频com| 成人午夜在线播放| 久久91精品久久久久久秒播| 亚洲一二三四区不卡| 国产调教视频一区|