WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Delay loading of background image (1 post)

  1. cableghost
    Member
    Posted 2 years ago #

    I have set a background image for a div to show only when the ad in the div is blocked. Upon page loading though, the background image appears first, then the ad appears.

    I have tried the following functions, but they give me syntax errors. I would appreciate having either function cleaned up, or I would certainly try an alternative...thanks.

    function loadBG(){
        document.getElementById("id").style.backgroundImage="/images/image.png";
    }
    window.onload=loadBG();
    function show() {
        AB = document.getElementById('id');
        AB.style.display = 'inline';
    }
    setTimeout("show()", 5000);

    -Scott

Topic Closed

This topic has been closed to new replies.

About this Topic