Re: Rollovers - images don't preload - why?

by "Mike Kear" <choicemag(at)hotmail.com>

 Date:  Thu, 01 Jun 2000 17:42:09 EST
 To:  KeithWBell(at)aol.com,
hwg-techniques(at)hwg.org
  todo: View Thread, Original
Keith, I can't thank you enough for going to the trouble to look for me.

And for all you others who suggested possibilities for me.

The solution turned out to be nothing.  It was indeed my browser that was 
the problem.  I had no idea until you friendly folks told me that selecting 
my IE5's preferences "Check for newer versions of stored pages" to "every 
time" would have the effect of causing it to go and get new copies of the 
rollover images every time the mouse came by.

So in fact my page had been working ok all along, it was only my browser 
that wasn't working how I wanted it.

But Keith also suggested an improvement to my code that made it work faster 
as well.   I have to figure out now how to change my Fireworks so it puts 
the preload images command in the head not the body tags.

Thanks everyone.

Cheers,
Mike Kear
AFP Web Development
Windsor, NSW, Australia



>From: KeithWBell(at)aol.com
>To: choicemag(at)hotmail.com, hwg-techniques(at)hwg.org
>Subject: Re: Rollovers - images don't preload - why?
>Date: Thu, 1 Jun 2000 02:49:20 EDT
>
>Mike, I looked at your site again with a variety of browsers after you made
>code the change I suggested, and I found that the rollver images ARE now
>preloading properly. If you're still experiencing a problem, maybe it's at
>your end as Jalal suggested - I've now heard several people describing this
>situation with the settings in IE5. Could that be it?
>
>Regards
>Keith Bell
>
>In a message dated 31/05/00 17:30:33 GMT Daylight Time, 
>choicemag(at)hotmail.com
>writes:
>
> > Thanks, I did that,but the rollovers still take 4-5 seconds to happen, 
>no
> >  matter how often i do it.  And I can see the modem activity as it calls
>the
> >  second image from the site.  So it's still not preloading.
> >
> >  I guess I ought to throw out Fireworks and do the javascript by hand
> >  instead.  Has anyone been able to make Fireworks produce rollovers that
>work
> >
> >  properly?
> >
> >  Any other ideas?
> >
> >  Cheers,
> >  Mike Kear
> >  AFP Web Development
> >  Windsor, NSW, Australia
> >
> >  >From: KeithWBell(at)aol.com
> >  >To: choicemag(at)hotmail.com, hwg-techniques(at)hwg.org
> >  >Subject: Re: Rollovers - images don't preload - why?
> >  >Date: Wed, 31 May 2000 12:06:04 EDT
> >  >
> >  >Hi Mike
> >  >
> >  >Just took a quick look at your page: your mouseover images are 
>actually
> >  >preloading - well, sort of. Your problem is that you are calling the
> >  >"preload" function from an onLoad event in the BODY tag - so it won't
> >  >execute
> >  >until AFTER the rest of the page has completely loaded.
> >  >
> >  >Instead of making the function call from the onLoad event, just put it 
>in
> >  >the
> >  >HEAD section after defining the preload function, like this:
> >  >
> >  >/* Functions that handle preload. */
> >  >function MM_preloadImages() { //v3.0
> >  >  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
> >  >    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0;
> >  >i<a.length;
> >  >i++)
> >  >    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image;
>d.MM_p[j++].src=a[i];}}
> >  >}
> >  >
> >  >MM_preloadImages(
> >  >'/images/HomePage_f2.gif',
> >  >'/images/WhatsNew_f2.gif',
> >  >'/images/Comment_f2.gif',
> >  >'/images/NewReleases_f2.gif',
> >  >'/images/MajorEvents_f2.gif',
> >  >'/images/BillMonroe_f2.gif',
> >  >'/images/Forums_f2.gif',
> >  >'/images/Teachers_f2.gif',
> >  >'/images/Instruments_f2.gif',
> >  >'/images/Societies_f2.gif',
> >  >'/images/Links_f2.gif'
> >  >)
> >  >
> >  >and it should have the desired effect. There are other (and possibly
> >  >simpler!) ways to do this, but this should work without you re-hashing
>much
> >  >code. By the way, another HWG member Larry Coats has a good tutorial 
>on
> >  >rollovers on his site at:
> >  >
> >  >http://wolves.dreamhost.com/web/js/im01.htm
> >  >
> >  >or check out Ryan Holsten's "In search of the perfect rollover" on A 
>List
> >  >Apart at:
> >  >
> >  >http://www.alistapart.com/stories/rollover/rollover1.html
> >  >
> >  >Regards
> >  >Keith Bell
> >  >
> >  >In a message dated 31/05/00 16:27:40 GMT Daylight Time,
> >  >choicemag(at)hotmail.com
> >  >writes:
> >  >
> >  > > I'm preparing a site, using rollovers produced from Macromedia
> >  >Fireworks3.
> >  > >  It's the first time I've done rollovers that way, and to tell the
> >  >truth,
> >  >it
> >  > >  all looks like gobbledegook to me.  In the past I've been able to
> >  >understand
> >  > >
> >  > >  the javascript written by these apps, but in this case, its 
>totally
> >  > >  impenetrable for me.
> >  > >
> >  > >  And it's not working right.  I hope someone who knows more about
> >  >javascript
> >  > >  than I can tell me what's wrong
> >  > >
> >  > >  The images are swapping ok, but the mouseover images aren't
>preloading.
> >  >The
> >  > >
> >  > >  page is going to the site to get the images as the mouse goes over
>it.
> >
> >  >SO
> >  > >  it's not swapping fast.

________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA