P
P
Piratborn2016-03-20 16:37:34
JavaScript
Piratborn, 2016-03-20 16:37:34

Follow links greasemonke. How to improve?

There is a button and its function:

/*-------------------------- ButtonCreate --------------------------*/
var input=document.createElement("input");
input.type="button";
input.value="Button";
input.onclick = minButtonC;
input.setAttribute("style", "position:absolute; float: right; right: 15px;");
input.className = "btn btn-xs btn-standart"; 
$('.comments-wall').before(input);
/*----- Button Click -----*/
function minButtonC()
{
var links = document.querySelectorAll('span.icon-m2'); // Ищем все ссылки с классом "icon-m2" 
Array.prototype.forEach.call(links, function(e){ // Проходим все найденные ссылки
e.click(); // Кликаем!
});
}

The point is this. It is necessary that the script search for all links with the "icon-m2" class (which has already been done) and click the first 10 links, then wait 15 seconds and so on until the links on the page run out. (for example: 1, 2, 3, 10 - wait 15 seconds and then 10, 11, 12, 20 - wait 15 seconds...)

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question