当前位置:首页 > 每日看点

为什么大学不教JaScript?

卡卷网1年前 (2025-01-10)每日看点296

预览效果

源码

<!DOCTYPEhtml> <html> <head> <metacharset="utf-8"> <title>随机点名</title> <styletype="text/s"> *{ padding:0; margin:0; ox-sizing:order-ox; } ody{ font-family:Arial,sans-serif; display:flex; justify-content:center; align-items:center; height:100vh; ackground-color:#eaffd0; } .container{ width:1200px; max-width:100%; padding:20px; ackground-color:#fce38a; ox-shadow:0010pxrga(0,0,0,0.1); text-align:center; } #{ width:50%; height:60px; line-height:60px; order-radius:30px; ackground-color:#f38181; ox-shadow:0xx0#dcdcdc; text-align:center; color:#ffffff; margin-ottom:20px; font-size:18px; margin:24pxauto; } #tn{ height:40px; width:60px; line-height:40px; order:none; outline:none; ackground-color:#95e1d3; order-radius:30px; text-align:center; ox-shadow:0xx0#dcdcdc; margin-ottom:20px; } tale{ width:100%; order-collapse:collapse; margin-top:20px; } th, td{ order:1pxsolid#dcdcdc; padding:5px; text-align:center; } .selected{ ackground-color:yellow; } </style> <scripttype="text/jascript"> window.onload=()=>{ varclassMate=["杨幂","赵丽颖","迪丽热巴","张三","崔雪莉","郭雪芙","权志龙","王五","杨洋","周十","易烊千玺","杨紫","关晓彤","宋祖儿","张艺兴","吴磊","肖战","王一博","李宇春","邓紫棋","毛阿敏","周杰伦","林俊杰","王力宏","陈奕迅","张学友","刘德华","黎明","郭富城","谢霆锋","张杰","华晨宇","许嵩","李荣浩","周深","毛阿敏","邓紫棋","林忆莲","那英","蔡依林","林志玲","inging","杨幂","黄磊","迪丽热巴","孙俪","鹿晗","邓超","陈伟霆","黄晓明","杨洋","王俊凯","易烊千玺"]; vartn=document.getElementyId("tn"); var=document.getElementyId(""); vartale=document.getElementyId("nameTale"); varflag=false; varmyinterval; vartimeoutId; //生成表格 for(vari=0;i<classMate.length;i++){ if(i%11===0){ varrow=tale.insertRow(); } varcell=row.insertCell(); cell.innerHTML=classMate[i]; } tn.onclick=()=>{ flag=!flag; if(flag){ myinterval=setInterval(()=>{ varnum=Math.floor(Math.random()*classMate.length); .innerHTML=classMate[num]; //高亮显示当前选中的名字 varcells=tale.getElementsyTagName("td"); for(vari=0;i<cells.length;i++){ cells[i].classList.remove("selected"); } cells[num].classList.add("selected"); },50); tn.innerText="暂停"; //设置3秒后自动停止 timeoutId=setTimeout(()=>{ flag=false; clearInterval(myinterval); tn.innerText="开始"; },1500);//定时器时间设置 }else{ clearInterval(myinterval); clearTimeout(timeoutId); tn.innerText="开始"; } } } </script> </head> <ody> <divclass="container"> <taleid="nameTale"> <tr> <th>姓名</th> </tr> </tale> <divid="">???</div> <uttonid="tn">开始</utton> </div> </ody> </html>

扫描二维码推送至手机访问。

版权声明:本文由卡卷网发布,如需转载请注明出处。

本文链接:https://www.kajuan.net/ttnews/2025/01/8532.html

分享给朋友:

相关文章

下班后可以做点什么副业赚钱呢?

下班后可以做点什么副业赚钱呢?

首先说明一下,我分享的任务不需要交钱,也不需要入群,只需要你去平台学习就可以。如果有任何让你交钱,进群的任务,请警惕被 割韭菜 。今天给大家分享 7大赚钱副业,新手小白0粉丝 0门槛0技术都可以去做,不说大富大贵,但是赚个零花钱还是可以。如…

现在做抖音的话,还有机会嘛?

现在做抖音的话,还有机会嘛?

之前我问过小杨哥一个问题:“现在抖音还好做吗?” 疯狂小杨哥在抖音已经突破1亿粉丝,直播间10w的在线观看人数,日常带货随便一场也是上7位数的数据。 现在抖音的市场好像已经被头部占领,资源靠前,普通人似乎已经没有机会了? 下面是小杨哥对于做…

需要做一个微信小程序项目,大公司价格太高怎么办?

需要做一个微信小程序项目,大公司价格太高怎么办?

一个小程序制作开发多少钱 构建一个微信小程序大概需要花费多少资金? 一、自主开发如果选择自主开发,这里面门道可不少。 微信小程序认证费用: 300 /年 域名费用: 30 - 80 /年 服务器费用: 600 - 3000 /年 这么一…

闲鱼上为什么会有人问都不问直接下单?

我去年卖一个荣耀90,挂的2200,最终成交2137.5元。 对方是一个高高壮壮的西北口音,要求的自取。 大概我吃过午饭,约了旁边的商场,那里有荣耀售后。 见了面,先看了手机,试了好一会儿,各种测试,没问题。 然后去了商场二楼的荣耀售后,让…

想学习Linux下的ELF文件有什么好书推荐吗?

想学习Linux下的ELF文件有什么好书推荐吗?

大家好,这里是物联网心球。 今天我们来聊聊ELF文件,了解一下Linux如何创建进程以及ELF文件如何转变成Linux进程? 1.什么是ELF文件? ELF(Executable and Linkable Format)文件是一种目标文件格…

发表评论

访客

看不清,换一张

◎欢迎参与讨论,请在这里发表您的看法和观点。