Randomize numbers with jQuery?

前端 未结 6 571
天涯浪人
天涯浪人 2020-12-05 17:44

Is there a simple jQuery way to create numbers randomly showing then a number 1 -6 is choosing after a few seconds? [Like dice]

6条回答
  •  执念已碎
    2020-12-05 17:55

    Others have answered the question, but just for the fun of it, here is a visual dice throwing example, using the Math.random javascript method, a background image and some recursive timeouts.

    http://www.jsfiddle.net/zZUgF/3/

提交回复
热议问题