Animate.startTime

Animate.startTime - час початку анімації елемента.

Синтаксис:

Animate.startTime;

Параметри:

Animate - об'єкт Animate.

Опис:

startTime властивість об'єкту Animate яка повертає/задає число мілісекунд початку анімації елемента. Якщо не було задано id то повертає null.

Приклад:

#test
var el=document.getElementById('test'); if(el.animate){ var anime= el.animate([{color:'#000',backgroundColor:'#ffffff'},{color:'#ffffff',backgroundColor:'#000000'}], {duration:3500}); alert(anime.startTime) }else alert('Ваш браузер не підтримує Animate');
#test2
var el=document.getElementById('test2'); if(el.animate){ var anime= el.animate([{color:'#000',backgroundColor:'#ffffff'},{color:'#ffffff',backgroundColor:'#000000'}], {duration:3500}); anime.startTime=2500; }else alert('Ваш браузер не підтримує Animate');

Приклад коли startTime є більшим за час самої анімації, тоді анімація як така не відбувається або призупиняється:

var el=document.getElementById('test3'); if(el.animate){ var anime= el.animate([{color:'#000',backgroundColor:'#ffffff'},{color:'#ffffff',backgroundColor:'#000000'}], {duration:3500}); anime.startTime=4000; }else alert('Ваш браузер не підтримує Animate');