Wait 5 seconds before run html code

Hi guys

i am a big noob so would be nice if u keep it as simple as possible :frowning:

i got a html code

<br><br>
<a href="http://jungezeit.eu/story.php?title=eurobonds-2-0-jetzt-gehts-an-steuerzahlers-letztes-hemd" target="_blank">
 mg s...h="240" height="80" border="0"></a>
<br>Steuerzahlers letztes Hemd
<br><br><br>

and now i would like to make this code to wait 5 seconds to run after page loaded.
sure its pretty easy to you but i dont get it work.

allready tryed this but it did not work
<script type="text/javascript">

    setTimeout(function() {

}, 5000);
</script>

<br><br>
<a href="http://jungezeit.eu/story.php?title=eurobonds-2-0-jetzt-gehts-an-steuerzahlers-letztes-hemd" target="_blank">
 <img src="http://imghost.in/img/2014-09/09/76adidks7i48a0lnlpge2ivnx.jpg" width="240" height="80" border="0"></a>
<br>Steuerzahlers letztes Hemd
<br><br><br>

What code should wait 5 seconds?

if you mean the HTML code to display after 5 seconds, set its CSS display to none and after 5 seconds set it to the previous value (an empty string, the browser figures out the rest).

hi thx for the quick reply.
like i told you - i am a noob :wink:
yes i mean the html code should wait 5 sec.
but i have no idea how to do this in css :frowning:

i am using it in admin area in ā€œSnippetsā€.
so is there any way to do it in here?

something like - go ahead and run next lines in 5 seconds?

I would hide the content using JS, as that way people who have JS disabled will still get to see something.

E.g.:

<div id="container">Will display after 5 seconds</div>

<script>
  var content = document.getElementById("container");
  content.style.display="none";
  setTimeout(function(){
    content.style.display="block";
  }, 5000);
</script>

thx a lot :slight_smile: worked.
didnt solved my problem but it worked :frowning:
strange there is no simple html command
wait 5000
or something

but hey thx anyway for the quick and simple help.

maybe you got also an other idea to fix my problem.
if i share something on facebook - everything worked well so far.
but now i added some small picture links in the sidebar and facebook ongraph
uses this pictures vor thumbnail and not my story picture anymore.

i found out i can do this in meta og:image but this is a bit to hard for me to do this dynamic and right.

do you have a simple quick n dirty idea what i can do to hide this img link from facebook?

thats why i tryed to hide the img links for 5 seconds :wink: if facebook dont see the img links it will choose the right one without changeing something else.

HTML is for structure and content, why should it have something like that?

no idea - why not - seams an easy thing for me and i would need it now :frowning:

so you have any idea how i can set an easy command in html body to tell facebook this image is important or alternativ forget the following img?

just because it looks like a good idea does not mean it is a good idea. Iā€™d like my HTML page to start my coffee machine first thing in the morningā€”certainly a good idea, but totally out of what HTML is intended for.

2 Likes