Question

Currently I have the following piece of code but it isn't working on my facebook iframe application.

function Timer(){
    document.getElementById('buybtn').style.visibility = "visible"; 
    setTimeout(Timer,1080000);
}

and the following html:

<p style="text-align: center;">'</p>
<div id="buybtn">
   <p style="text-align:center">
      <a href="http://www.google.com" target="_blank">
         <img src="http://www.adspecialist.be/wp-content/themes/adspecialist/img/visit-my-website-en.png" border="0" />
       </a>
   </p>
</div>

Could you please let me know how to fix this problem

Was it helpful?

Solution

Your code is not supposed to work, because Timer() will never be called since you have your timeout inside the function. Move it outside and it will work.

function Timer(){
    document.getElementById('buybtn').style.visibility = "visible"; 
}

setTimeout(Timer,3000);

demo jsfiddle

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top