JavaScript
- 5 ответов
- 0 вопросов
4
Вклад в тег
var index = 0;
var interval = null;
var image = document.getElementById("image");
var imagesURLs = [
"http://placehold.it/260x150",
"http://placehold.it/265x150",
"http://placehold.it/270x150",
"http://placehold.it/275x150"
];
image.onmouseover = function(){
interval = setInterval(function(){
if(!imagesURLs[++index]){
index = 0
}
image.src = imagesURLs[index]
}, 1000);
};
image.onmouseout = function(){
clearInterval(interval)
};
$timeout(function(){
// тут код
})
Array.from(container.childNodes).filter(function(child){
return child.classList && child.classList.contains('go')
})