0
How do I make words float across the screen???
What that says /\ |
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;
}
+ 1
ARE YOU PRONE TO SEIZURES?
yes
Then a dinosaur slides across the screen and roars at you loudly!!!