Edit in JSFiddle JavaScript HTML CSS Result h1 {
font-family: "微软雅黑";
font-size: 40px;
margin: 20px 0;
border-bottom: solid 1px #ccc;
padding-bottom: 20px;
letter-spacing: 2px;
} .time-item strong {
background: #C71C60;
color: #fff;
line-height: 49px;
font-size: 36px;
font-family: Arial;
padding: 0 10px;
margin-right: 10px;
border-radius: 5px;
box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
} #day_show {
float: left;
line-height: 49px;
color: #c71c60;
font-size: 32px;
margin: 0 10px;
font-family: Arial, Helvetica, sans-serif;
} .item-title .unit {
background: none;
line-height: 49px;
font-size: 24px;
padding: 0 10px;
float: left;
} var intDiff = parseInt(86400); //倒计时总秒数量 function timer(intDiff) {
window.setInterval(function () {
var day = 0,
hour = 0,
minute = 0,
second = 0; //时间默认值
if (intDiff > 0) {
day = Math.floor(intDiff / (60 * 60 * 24));
hour = Math.floor(intDiff / (60 * 60)) - (day * 24);
minute = Math.floor(intDiff / 60) - (day * 24 * 60) - (hour * 60);
second = Math.floor(intDiff) - (day * 24 * 60 * 60) - (hour * 60 * 60) - (minute * 60);
}
if (minute <= 9) minute = '0' + minute;
if (second <= 9) second = '0' + second;
$('#day_show').html(day + "天");
$('#hour_show').html('<s id="h"></s>' + hour + '时');
$('#minute_show').html('<s></s>' + minute + '分');
$('#second_show').html('<s></s>' + second + '秒');
intDiff--;
}, 1000);
} $(function () {
timer(intDiff);
}); <h1>网页上的倒计时</h1> <div class="time-item">
<span id="day_show">0天</span>
<strong id="hour_show">0时</strong>
<strong id="minute_show">0分</strong>
<strong id="second_show">0秒</strong> </div> ---------------------------------------排序
function test() {
var numbers = [12, 23, 10, 56, 7, 88, 92, 49];
numbers = numbers.sort(function (a, b) {
return a - b;
})
var val;
for (var i = 0; i < numbers.length; i++) {
val += numbers[i] + '<br/>'; }
$('#show8').html(val); } <div>
<input type="button" value="提交" onclick="test()" />
<h3>数值数组排序前</h3>
<div id="show7"></div>
<h3>排序后</h3>
<div id="show8"></div>
</div>

asp.net js 倒计时总秒数量 和 排序的更多相关文章

  1. js倒计时,秒倒计时,天倒计时

    按天倒计时 HTML代码1: <Script Language="JavaScript"> <!-- Begin var timedate= new Date(& ...

  2. 小巧实用js倒计时

    <script type="text/javascript">     var intDiff = parseInt(15); //倒计时总秒数量     functi ...

  3. js 验证码 倒计时60秒

    js 验证码 倒计时60秒 <input type="button" id="btn" value="免费获取验证码" /> & ...

  4. js实现倒计时60秒的简单代码

    <!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="Conten ...

  5. js 简单实现获取短信按钮倒计时60秒

    <!DOCTYPE html><html lang="en"><head> <meta http-equiv="Content- ...

  6. js倒计时-倒计输入的时间

    计算指定时间到指定时间之间相差多少天.时.分.秒. 节日.活动.商城常用. 原理: 主要使用到时间戳,也就是从1970 年 1 月 1 日 到指定时间的毫秒数. 1. 求出毫秒差 :当两个时间直接进行 ...

  7. js 倒计时(可自定义时间)

    <html> <head> <title>js 倒计时</title> </head> <body> <div> & ...

  8. js倒计时显示

    <!DOCTYPE html><html> <head> <meta charset="UTF-8"> <title>j ...

  9. iOS-验证码倒计时60秒

    一. 要求 1.点击获取验证码按钮,60秒倒计时,按钮变成不可点击状态,按钮文字变成倒计时的秒数. 2.当倒计时为0的时候,释放掉定时器NSTimer,按钮变成可以点击状态,按钮文字变成"获 ...

随机推荐

  1. python学习笔记整理——列表

    Python 文档学习笔记 数据结构--列表 列表的方法 添加 list.append(x) 添加元素 添加一个元素到列表的末尾:相当于a[len(a):] = [x] list.extend(L) ...

  2. 63-w 简明笔记

    显示关于系统用户的信息 w [options] [username] w用于显示当前登录系统的用户的名字以及他们的终端设备编号.登录时间.正在运行的命令和其他一些信息 参数 username 限定仅显 ...

  3. 网上找到的一个jquery版网页换肤特效

    这个跟我之前在锋利的JQuery那本书里看到的那个一模一样. <!DOCTYPE html> <html> <head> <meta name="& ...

  4. 创建模型,设置id

    /** * 创建模型,设置id */ Ext.onReady(function(){ Ext.define('Person',{ extend:'Ext.data.Model', idProperty ...

  5. Integer与int的种种比较

    package com.lxm.basics; public class IntegerTest { public static void main(String[] args) { Integer ...

  6. logstash 配置文件实例

    这个配置文件记不起来是从那个地方下载的来的了,感谢那位无私的朋友 input {  beats {            #shipper 端用的是 filebeat,所以用这个插件     port ...

  7. Hibernate正向工程(实体类-->数据库)

    1,新建实体类News.java package com.hanqi.dao; import java.util.Date; public class News { private Integer i ...

  8. react.js table组件【可以直接使用】

    最近在做一个CMS,使用的技术是刚刚学习的react.js,准备制作一个查询的页面以及一个新增的页面. 这是table的公共组件: 我们在使用的过程中,只会用到: 制作出来的查询页面: 新增页面: 上 ...

  9. 树分治 点分治poj 2114

    存在2点间距离==k 输出AYE 否则输出NAY #include<stdio.h> #include<string.h> #include<algorithm> ...

  10. java-URLConnection网络数据收取

    通过url创建connection方式收取 import java.io.BufferedReader; import java.io.ByteArrayOutputStream; import ja ...