Git Product home page Git Product logo

countdown-effect's Introduction

Countdown-effect

HTML+CSS+JavaScript实现时间显示、倒计时差、限时抢购三种效果

Javascript日期操作

时间对象是一个我们经常要用到的对象,无论是做时间输出、时间判断等操作时都与这个对象离不开。 它是一个内置对象——而不是其它对象的属性,允许用户执行各种使用日期和时间的过程。

Date()返回当前的日期和时间

  • getDate() 查看Date对象并返回日期 (1-31)
  • getDay() 返回星期几(0-6)
  • getHours() 返回小时数 (0-23)
  • getMinutes() 返回分钟数 (0-59)
  • getMonth() 返回月份值 (从0开始,+1)
  • getSeconds() 返回秒数
  • getTime()返回毫秒数
  • getYear() 返回年份 获得年最好用 getFullYear()方法来操作(完整格式 如2017

Date对象

  • Var myDate = new Date()
  • Date对象会自动把当前的日期和时间保存为其初始值

Math对象方法

Math.ceil(x)方法执行的是向上取整计算,它返回的是大于或等于函数参数,并且与之最接近的整数。

例如:

  • Math.ceil(12.2)返回13
  • Math.ceil(12.7)返回13
  • Math.ceil(12.0)返回12

countdown-effect's People

Contributors

windcanvas avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.