JSFiddle - React, Tailwind, and code Playground
by Limitedmoves
HTML
<body>
<div class="vRock">!</div>
<button class='start'>Start</button>
<button class='pause'>Pause</button>
</body>
CSS
.vRock {
border-style:solid;
border-color:blue;
position:fixed;
bottom: 30%;
left: 50%;
width: 100px;
height: 200px;
}
JavaScript
$(document).ready(function () {
$('.start').click(function () {
// alert("test");
reSize();
});
});
function reSize() {
var randNumber = 1 + Math.floor(Math.random() * 4000);
setTimeout(function () {
var randNumber2 = 1 + Math.floor(Math.random() * 400);
$(document).ready(function () {
$('.vRock').animate({
height: randNumber2
}, 500);
reSize();
});
},
randNumber);
$('.pause').click(function () { //Start pause function
var vTempTimer= randNumber;
alert(vTempTimer);
});
}