前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布

djs

作者头像
发布2021-11-08 10:23:32
1320
发布2021-11-08 10:23:32
举报
文章被收录于专栏:IT杂症
代码语言:javascript
复制
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Game</title>
    <script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>
    <style>
        html,body{position: relative;height: 100%;overflow: hidden;}
        .flex{display: flex;height: 100%;}
    .word{font-size: 180pt;text-align: center;padding: 0;margin:0;vertical-align: middle;margin:auto;}
    button{position: absolute;bottom:0;font-size: 50pt;cursor: pointer;}
    </style>
    <script>
    $(function(){
        var  wordlist=['电脑','乌龟','葛优','ipad']
       
        var t=120;
    function js(){
        
      
        $('#time').text(t--)
        console.log(t)
        if(t <= 0) {
 
            clearInterval(inter);
        }


    }
  
        function dati(){
            var gettime = setInterval(js, 1000);
            var len=wordlist.length;
            var  nums = Math.floor(Math.random() * len);
            $('.word').text(wordlist[nums])
            console.log(wordlist.length)

            wordlist.splice(nums,1)
            if(wordlist.length==0){
                $('.word').html('<span style="font-size:100pt;color:#f00">题库用完,请重选题库!</span>')
               

            }
        }

$('#begin').click(function(){

dati()

})
    })
 

    </script>
</head>
<body>
    <div style="font-size:60pt">倒计时:<span class="red" id='time'></span>秒</div>
    <div class="flex">
    <h1 class='word'>Ready?</h1></div>
   <button id="begin">  下一个 </button>
   
</body>
</html>
本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2020年01月12日,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档