Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Preloading Images with MM_preloadImages

Posted on 2003-11-24
9
Medium Priority
?
543 Views
Last Modified: 2008-03-10
Dear all,

I seem to be having a problem with preloading images - I am setting up a photo library, with thumbnails that display the full size image when you hover over the thumbnail.  I am preloading the hover images, about 30-40k each, using MM_preloadImages.  Everything works fine, until I get more than about 20 preloaded images.  What I think is happening is that it is taking longer to preload the images than it is to load the page, and so there is a delay after the page has finished loading and before the first hover over image appears.

Is there anyway I can get round this?  I had hoped it would start displaying the images before the last few had finished loading, but it doesnt seem to work.  Im sure there is an easy solution to this, but I cant think of one at the moment - hence my post!

Thanks
0
Comment
Question by:BlueEdger
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
9 Comments
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 9810304
>>
I had hoped it would start displaying the images before the last few had finished loading, but it doesnt seem to work.
<<

That would go against the whole idea of preloading the images in a sense...



0
 
LVL 1

Author Comment

by:BlueEdger
ID: 9810340
Yes I guess it does really!

Is there anyway I could detect when the pre-load has finished and display something to show the user could continue?  I know people are going to think the site is broken if the image does not appear straight away.
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 9810356
Does this happen only with slow (dial-up) connections or with fast ones as well?

FtB
0
Build and deliver software with DevOps

A digital transformation requires faster time to market, shorter software development lifecycles, and the ability to adapt rapidly to changing customer demands. DevOps provides the solution.

 
LVL 1

Author Comment

by:BlueEdger
ID: 9810362
Its happening with fast ones as well.  So its going to be terrible on a dial up.
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 9810470
That is a little strange....where do you call the preloading of images, on the onLoad() of the body?

FtB
0
 
LVL 1

Author Comment

by:BlueEdger
ID: 9810508
Yes.

<body leftmargin="0" topmargin="0" rightmargin="0" bottommargin="0" marginwidth="0" onLoad="MM_preloadImages('image01.jpg','image02.jpg','image03.jpg','image04.jpg','image05.jpg','image06.jpg','image07.jpg','image08.jpg','image09.jpg','image10.jpg','image11.jpg','image12.jpg','image13.jpg','image14.jpg','image15.jpg','image16.jpg','image17.jpg','image18.jpg','image19.jpg','image20.jpg','image21.jpg','image22.jpg','image23.jpg','image24.jpg','image25.jpg','image26.jpg','image27.jpg','image28.jpg')">

I've only ever used preload this way.  I have seen it done via a script in the head though, although it seems very long winded.  Is there a better way to tackle this?
0
 
LVL 46

Accepted Solution

by:
fritz_the_blank earned 200 total points
ID: 9810545
You might want to take a look here in case, but I guess that you are running into a wall in terms of the limits of preloading:

http://hotwired.lycos.com/webmonkey/98/29/index3a_page3.html?tw=programming


FtB
0
 
LVL 1

Author Comment

by:BlueEdger
ID: 9810881
Yes, there is a lot to preload, I guess its just one of those things.

I'll just have to educate my visitors to be a bit patient!

Thanks for your help.
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 9810933
Just one thing to think about:

Once the images get loaded, they stay in cache for the visit. You might consider using a frame or a pop up window that calls the preloading and have your regular window to display what you need right away. That way, you will get the best of both worlds.

FtB
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

704 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question