how to get a div to randomly move around a page (using jQuery or CSS)

前端 未结 7 882
旧时难觅i
旧时难觅i 2020-11-29 00:01

I\'ve been doing some Googling to find an answer to this, but I\'ve had no luck. It could be because I\'m a bit of an amateur and I don\'t know the proper terms to search f

7条回答
  •  时光取名叫无心
    2020-11-29 00:37

    You could use jQuery Slide and Math.random(), generating one random number to use as the distance to move and another random number to base your decision on which direction to move in.

提交回复
热议问题