random bg javascript code

Out of context: Reply #19

  • Started
  • Last post
  • 23 Responses
  • vsc0

    já fiz o copy/paste:

    Untitled Document

    images = new Array();
    images.push("../img_db/01.gif");
    images.push("../img_db/02.gif");
    images.push("../img_db/03.gif");
    var img = Math.floor(images.length*Math.ra...
    function randombg(){
    document.body.style.backgroundIm...
    }

    if (window.addEventListener) window.addEventListener("load", randombg, false);
    else if (window.attachEvent) window.attachEvent("onload", randombg);
    else if (document.getElementById) window.onload=randombg;

    não está a dar.. :?

View thread