1.0.1 • Published 4 years ago
learn-raf v1.0.1
CountDown class
a CountDown class, which provide start and stop method and render to target DOM.
API
method | params | description |
---|---|---|
startCountdown | - | start countdown |
stopCountdown | - | stop countdown |
usage
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
</head>
<body>
<div id="app"></div>
<script src="./index.js"></script>
<script>
const instance = new CountDown("app");
instance.startCountdown();
setTimeout(() => {
instance.stopCountdown();
}, 2000);
</script>
</body>
</html>
develop
yarn install
yarn build