Display Image After Time Period

3 replies
Hey guys,

Just wondering if anyone know's a simple way to display an image after a certain amount of time on a web page, preferably using just html.

#display #image #period #time
  • Profile picture of the author NSA
    Hi Freddie Worrall,

    Here is how you can do it:
    http://seandebutts.com/2013/07/03/ht...mages-iframes/

    Even more simple:
    http://www.javascriptsource.com/page...ge-loader.html

    A plain html solution should be nearly impossible. JavaScript (e.g. jQuery is perfect for such scripted events, this should be not too hard to do if you already know html)

    However, the presented solutions should be working small and simple style.

    Cheers!
    Signature

    If you want real authority backlinks from sites like Wikipedia.org, this is my way to go: www.wikilink.biz

    {{ DiscussionBoard.errors[9767450].message }}
  • Profile picture of the author seoboyz01
    You could use a lightbox, though it would pop over and obstruct your other content. That's often used for pop over style email list displays.
    Signature
    Google DOMINATION SEO service - Take your site 1st page of Google.
    {{ DiscussionBoard.errors[9768588].message }}
  • Profile picture of the author Freddie Worrall
    Thanks for the reply guys, for anyone else trying to do this, I found a solution somwhere, it took a little tweaking, but it now works with this:

    <script type = "text/javascript">
    function displayNextImage() {
    x = (x === images.length - 1) ? 0 : x + 1;
    document.getElementById("img").src = images[x];
    }


    function startTimer() {
    setTimeout(displayNextImage, 230000);
    }

    var images = [], x = -1;
    images[0] = "bbpaybutton.jpg";
    images[1] = "image1.jpg"
    </script>

    AND then refrence the image like this where you want it displayed:

    <img id="img" src="image1.jpg"></a>

    Obviously change the image names to match what your images are called.

    The above code will display image1.jpg for 230000ms / 230s / 3min 50secs and then switch to bbpaybutton.jpg, I've made image1.jpg about a 2 pixels in size and the same colour as the background.

    Hope this helps someone!
    {{ DiscussionBoard.errors[9774822].message }}

Trending Topics