11
rated 0 times
[
15]
[
4]
/ answers: 1 / hits: 24200
/ 7 Years ago, wed, march 1, 2017, 12:00:00
I made this really basic startup page in HTML that has images that reference websites. Is there a way to add a loader after the user clicks on the image then the loader goes away when the website comes up? I am trying to give users something to look at while a website loads. Below is a sample href line that I use.
<a href=https://Website.com><img border=0 alt=Image src=logo.gif></a>
I found this onclick script online but I do not know how to add it to my startup page. Can anyone help me put these together? Where should I place the line 'onclick=myFunction()?'Thank you!
onclick=myFunction()
<script>
var myVar;
function myFunction() {
myVar = setTimeout(showPage, 3000);
}
function showPage() {
document.getElementById(loader).style.display = none;
document.getElementById(myDiv).style.display = block;
}
</script>
More From » jquery