I am trying to write a page where it loads several objects in an timed order using JavaScript. I've managed to make objects blink using CSS3, but not quite sure how to combine it with timer in JavaScript.
here is my code:
<script language="javascript">
$(document).ready(function () {
var t;
function blink(){
$("#blinkfirst").setOpacity(0);
$("#blinkfirst").setStyle({visibility: 'visible'});
new Effect.Opacity(
"#blinkfirst", {
from: 0.0,
to: 1.0,
duration: 1.0
}
);
}
function appear(){
t=setTimeout('blink()', 8);
}
});
</script>
my logic is to write one function to change the opacity of a div from 0.0 to 1.0, so it will show up. and then write another function to call this function after every certain seconds for different objects. for example, make div1 appears first, and 8 seconds later, div2 appears; 8 seconds later, div3 appears...