06-24-2021, 04:28 PM
http://d21c.com/leprofesseur/tango-club.html
This is the script to move bottom right dancer
function movet8(){
var step=-1;
var x=document.getElementById('tango8').offsetLeft;
var y=document.getElementById('tango8').offsetTop;
if(y > 406 )
{y= y +step;x=x -1;
document.getElementById('tango8').style.left= x + "px";
document.getElementById('tango8').style.top= y + "px";
setTimeout('movet8()',50);}
else { setTimeout("movet5()",1000);}
}
Y sets the vertical destination x is incremented for horizontal destination
minus value is up or left and plus value is down or right
This is the css code that varies each element opacity
.delay {
animation-name: wait;
animation-delay: 0s;
animation-duration: 20s;
animation-iteration-count: 1;
}
@keyframes wait{0%{opacity:0.2}100%{opacity:1}}
each element is assigned its own class eg(.delay-element id)
with hte appropriate delay/duration and iteration
This is the script to move bottom right dancer
function movet8(){
var step=-1;
var x=document.getElementById('tango8').offsetLeft;
var y=document.getElementById('tango8').offsetTop;
if(y > 406 )
{y= y +step;x=x -1;
document.getElementById('tango8').style.left= x + "px";
document.getElementById('tango8').style.top= y + "px";
setTimeout('movet8()',50);}
else { setTimeout("movet5()",1000);}
}
Y sets the vertical destination x is incremented for horizontal destination
minus value is up or left and plus value is down or right
This is the css code that varies each element opacity
.delay {
animation-name: wait;
animation-delay: 0s;
animation-duration: 20s;
animation-iteration-count: 1;
}
@keyframes wait{0%{opacity:0.2}100%{opacity:1}}
each element is assigned its own class eg(.delay-element id)
with hte appropriate delay/duration and iteration