How do I make words float across the screen??? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How do I make words float across the screen???

What that says /\ |

17th Nov 2016, 9:51 PM
creepercoderx9
2 Answers
+ 3
try using javascript. html <div class='a'></div> javascript $(document).ready(function(){ animateDiv(); }); function makeNewPosition(){ // Get viewport dimensions (remove the dimension of the div) var h = $(window).height() - 50; var w = $(window).width() - 50; var nh = Math.floor(Math.random() * h); var nw = Math.floor(Math.random() * w); return [nh,nw]; } function animateDiv(){ var newq = makeNewPosition(); $('.a').animate({ top: newq[0], left: newq[1] }, function(){ animateDiv(); }); }; css div.a { width: 50px; height:50px; background-color:red; position:fixed; }
23rd Nov 2016, 6:20 PM
Metrik 🕵
Metrik 🕵 - avatar
+ 1
ARE YOU PRONE TO SEIZURES? yes Then a dinosaur slides across the screen and roars at you loudly!!!
8th Jan 2017, 3:08 AM
koder
koder  - avatar