SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    Under Construction Poop_Shoot's Avatar
    Join Date
    Jul 2003
    Location
    Sacramento, CA
    Posts
    330
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Preloaded Question?

    Basically I wanted to create a multidim array for the mouseover buttons one on one off! But I am not quite sure that I have this correct? I need someone to pick it apart! Please!
    Code:
    var onImg=["homeon.gif","logoon.gif","designon.gif","abouton.gif","helpon.gif"];
    var offImg=["homeoff.gif","logooff.gif","designoff.gif","aboutoff.gif","helpoff.gif"];
    var ln=onImg.length;
    var loadedImgs=[];
    function slct(on,off){
    this.on=on;
    this.off=off;
    }
    for(i=0;i<ln;i++){
    loadedImgs[i]=new Image();
    loadedImgs[i]=new slct(onImg[i],offImg[i]);
    }
    I removed the .src at the end of the loop because it returned undefined it seems to work now but is it still preloading them? Thanx

    Jon

  2. #2
    SitePoint Evangelist Mr. Brownstone's Avatar
    Join Date
    May 2002
    Location
    Relative
    Posts
    452
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Iím too lazy to answer your question directly, so instead Iím going to provide your with a link showing how to create roll-overs using only CSS and no annoying pre-loading:

    http://www.pixy.cz/blogg/clanky/cssnopreloadrollovers/
    Of course, that's just my opinion. I could be wrong.

  3. #3
    "Of" != "Have" bronze trophy Jeff Lange's Avatar
    Join Date
    Jan 2003
    Location
    Calgary, Canada
    Posts
    2,063
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It didn't work in IE6.
    Who walks the stairs without a care
    It shoots so high in the sky.
    Bounce up and down just like a clown.
    Everyone knows its Slinky.

  4. #4
    SitePoint Evangelist Mr. Brownstone's Avatar
    Join Date
    May 2002
    Location
    Relative
    Posts
    452
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Youíve got to click-through to the example, Jeff.
    Of course, that's just my opinion. I could be wrong.

  5. #5
    "Of" != "Have" bronze trophy Jeff Lange's Avatar
    Join Date
    Jan 2003
    Location
    Calgary, Canada
    Posts
    2,063
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    /me smacks head

    DOH
    Who walks the stairs without a care
    It shoots so high in the sky.
    Bounce up and down just like a clown.
    Everyone knows its Slinky.


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
  •