SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Apr 2004
    Location
    Asheville NC
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    understanding image preloading

    hello;

    am I correctly referrencing my preloaded images?
    Code:
    <script ...>
    image1 = new Image();
    image1.src = "circle_1.gif";
    
    image2 = new Image();
    image2.src = "circle_2.gif";
    
    function do_it()
      { if (true) 
          { document.getElementById("a_div").innerHTML = "<img src='circle_1.gif' />"; 
          }
        else
          { document.getElementById("a_div").innerHTML = "<img src='circle_2.gif' />";
          };
      }
    </script>
    thanks
    Shannon Burnett
    Asheville NC USA

  2. #2
    masquerading Nick's Avatar
    Join Date
    Jun 2003
    Location
    East Coast
    Posts
    2,215
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    From what I can tell, yes, those images should be preloading correctly.
    Nick . all that we see or seem, is but a dream within a dream
    Show someone you care, send them a virtual flower.
    Good deals on men's watches


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •