zoukankan      html  css  js  c++  java
  • jQuery.countdown 倒计时插件的使用

    这个插件真的挺好用的,虽然好用但是我还是记下来吧,好多插件,今天修改项目的时候看见他居然懵逼

    官网地址    http://hilios.github.io/jQuery.countdown/

    时间的格式有三种 这些事官网上介绍的

    第一个例子 

    一个页面多个倒计时  

    <div data-countdown="2017/11/01"></div>
    <div data-countdown="2017/11/01"></div>
    <div data-countdown="2018/01/01"></div>
    <div data-countdown="2019/01/01"></div>
    <script src="jquery-1.11.3.min.js"></script>
    <script src="jquery.countdown.js"></script>
    <script>
    $('[data-countdown]').each(function(){
    var $this = $(this), finalDate = $(this).data('countdown');
    $this.countdown(finalDate, function(event) {
    $this.html(event.strftime('%D 天 %H:%M:%S'));
    });
    })

    </script>

    2.传统模式的倒计时

    <div id="clock"></div>
    <script src="jquery-1.11.3.min.js"></script>
    <script src="jquery.countdown.js"></script>
    <script>
    $('#clock').countdown('2017/10/10', function(event) {
    var $this = $(this).html(event.strftime(''
    + '<span>%D</span> 天 '
    + '<span>%H</span> 小时 '
    + '<span>%M</span> 分钟 '
    + '<span>%S</span> 秒'));
    });
    </script>


  • 相关阅读:
    R set.seed()
    R tapply()
    R table
    清除R console中出现加号+
    r向量映射
    Java常识1
    IDEA配置
    SQL.字符串重叠项数量统计
    SQL.数据库内拆分字符串并返回数据表
    IDEA--TomCat配置
  • 原文地址:https://www.cnblogs.com/dengxiaolei/p/7647951.html
Copyright © 2011-2022 走看看