Este é realmente um exercício para números aleatórios do JS. Primeiro, escreva os nomes de todos em uma matriz com antecedência e depois deixe que os valores na matriz sejam exibidos rapidamente na área. Quando você pressiona a parada, a rolagem para para obter um efeito aleatório.
<! Doctype html> <html> <head> <meta charset = "utf-8"/> <title> Nome aleatório escrito por JS-Qiongtai blog </title> <script type = "text/javascript"> var isrun = true; var a = ["zhang san", "li si" "" Array (); função action (str) {var s = document.getElementById ("bt"). Value; if (s == "start") {isrun = true; run (); document.getElementById ("bt}}}). Math.floor (Math.Random () * A.Length+ 1) -1; document.getElementById ("show"). INnerHtml = a [i]; if (isrun == false) {var b = true; para (var j em A2) {if (a2 [j] == i) {b = false;} a2 [a2.Length] = i; return;}} setTimeout ("run ()", 10);} </script> </adhead> <body> <div style = "text-align: Center; margin-top: 100px; largura: 100%;"> <id id = "Show" style = "margem: auto; font-size: 50px; largura: 100px; altura: 50px; fundo: #ffeeff"> </div> <div style = "margin-top: 20px;"> <input id = "bt" type = "button" onclick = "action ()" = "start"/> </div>