orhuncan
orhuncan

Reputation: 11

Show image, wait 10 second and load page content

i want to stop html loading after an specific img tag, wait 10 seconds.. and continue...

i mean, the lines at below of <img id='waitme' src='logo.png'>, must be read/load 10 seconds after the selected img tag(#waitme).

i tried with JQUERY wait(), delay() functions; but couldnt solve.

i will add this img tag at after tag, and all content of the site must be load 10 seconds after this image shown.

show #waitme, wait 10 second, load page content..

Could someone help me?

Upvotes: 1

Views: 3130

Answers (2)

Horo
Horo

Reputation: 102

You can try this:

...
<style>
     .disabled{
           display: none;}
</style>
<body>
 <img src="your_image.jpg" id="ur_img">
 <div id="wrap" class="disabled">
      Here is your content
 </div>
 <script>
     setTimeout(function(){
          $("#wrap").removeClass("disabled");
          $("#ur_img").addClass("disabled");
         }, 10000)

 </script>
</body>
...

Upvotes: 1

Rajaprabhu Aravindasamy
Rajaprabhu Aravindasamy

Reputation: 67207

Here is a way to achieve what you want,

  1. Display this image in document's ready handler and hide the page's content.
  2. Start a timeOut function in windows load handler with 10k milliseconds.
  3. In the call back of timeout, hide the image and display the page content.

Upvotes: 0

Related Questions