Skip to content

Instantly share code, notes, and snippets.

@LtAstros
Created July 25, 2017 22:01
Show Gist options
  • Save LtAstros/5a695b024232498affce9176e4741859 to your computer and use it in GitHub Desktop.
Save LtAstros/5a695b024232498affce9176e4741859 to your computer and use it in GitHub Desktop.
Exported from Popcode. Click to import: https://popcode.org/?gist=5a695b024232498affce9176e4741859
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<div id="blop1" class="blops"></div>
<div id="blop2" class="blops"></div>
<div id="blop3" class="blops"></div>
<div id="blop4" class="blops"></div>
<div id="blop5" class="blops"></div>
<div id="blop6" class="blops"></div>
<div id="blop7" class="blops"></div>
<div id="blop8" class="blops"></div>
<div id="blop9" class="blops"></div>
<div id="blop10" class="blops"></div>
<div id="character"></div>
</body>
</html>
{"enabledLibraries":["jquery"]}
var random = (Math.floor((Math.random() * 100) + 1)) + "%";
var dd = 1;
setInterval(function(){
for(var count = 1; count < 11; count = count + 1){
$("#blop"+count).css("top", $("#blop"+count).offset().top + 1);
}
},1);
for(var count = 1; count < 11; count = count + 1){
$("#blop"+count).css("top", -125 * count);
}
.blops {
width: 20px;
height: 20px;
background-color: salmon;
position: absolute;
}
#character {
width: 50px;
height: 50px;
background-color: yellow;
position: absolute;
top: 85%;
left: 50%;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment