F
F
frees22014-11-17 17:34:49
YouTube
frees2, 2014-11-17 17:34:49

How to make two events on onclick with setTimeout on second event?

Friends, help. For example:

<span  onclick="history.pushState('3vTP7WalcJc', null, null); return false"  class="loadvid2">МУЗТВ Онлайн  ></span>

1
If the event is single, that is, we turn on a single video, it works like a clock.
2
If we turn on the online broadcast, then the tricky YouTube first shows the advertising video (any other video) and then the original broadcast (3vTP7WalcJc). You have to click on the link a second time (span onclick).
Question.
How to make two events on onclick with setTimeout (or otherwise) on the second event?
Thanks in advance!
Perhaps I asked the wrong question.
The logic is this.
We click once, the event is triggered, after 5 seconds, the second event is triggered, that is, everything happens with one click.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Deodatuss, 2014-11-17
@Deodatuss

jsfiddle.net/s07njzkz/1

N
Nikita Gushchin, 2014-11-17
@iNikNik

<span  onclick="clickHandler()"  class="loadvid2">МУЗТВ Онлайн  ></span>

function clickHandler(){
    // Событие 1
    setTimeout(function(){
        // Событие 2, через 5 секунд
    }, 5000);
    return false;
}

D
dom1n1k, 2017-02-12
@Ingernirated

Ubuntu, saturation most likely Medium
https://fonts.google.com/specimen/Ubuntu

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question