0
i need to repeat this several times...
hi friends... some time ago, I was looking for a function that delayed the loading of a page from a hyperlink. I finally do it, but now I face another challenge ...how to apply the same function on several links??? is it possible? here is the code: https://code.sololearn.com/WucwujIkqsB0/#js
2 Respuestas
+ 1
Hey, just give the function assigned to the onclick event a name like this:
function delayClick() {
var www = this.href;
var f = function(){ window.location.href=www };
setTimeout(f,250);
return false;
}
And every time you want to use it on a link, give the link an id, say link1 for example, then add this to this script:
document.getElementById('link1').onclick = delayClick();
0
thank you very much friend, your help solved my problem ....