473,396 Members | 1,997 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

preload images?

12
hi all,

i have 50 hidden div layers with images insided, each is appr. 200kb big.

i use this script to show/hide them, when neccesary:

Expand|Select|Wrap|Line Numbers
  1. function init() {
  2. IE = (document.all)
  3. NC = (document.layers)
  4. Opera = (document.getElementById)
  5. }
  6.  
  7.  
  8.  function hide(id) {
  9. init();
  10. if(IE) eval('document.all[id].style.visibility = "hidden"')
  11. if(NC) eval('document.layers[id].visibility = "hidden"')
  12. if(Opera) eval('document.getElementById(id).style.visibility = "hidden"')
  13. }
  14.  
  15. function show(id) {
  16. init();
  17. if(IE) eval('document.all[id].style.visibility = "visible"')
  18. if(NC) eval('document.layers[id].visibility = "visible"')
  19. if(Opera) eval('document.getElementById(id).style.visibility = "visible"')
  20. }
  21.  
the code is used, when i click on some link.

but the problem is, that the layers with hidden images sometimes are loading too slowly. how can i preload them in this case? maybe it is possible to preload them in variables and them call with a script... ?

i would appreciate any advice. thx :)
Apr 25 '07 #1
3 1692
Logician
210 100+
hi all,

i have 50 hidden div layers with images insided, each is appr. 200kb big.
So you're expecting the user to download 10MB of data, and you wonder why it's taking too long?

If all these images are being downloaded automatically on page load, then preloading isn't going to change anything.

Presumably these images are JPEGs - have they been web optimised?

Do you have a URL?
Apr 25 '07 #2
Grimm
4
just to agree...50 images at 200Kb each =10000Kb or 10Mb I have not seen the web user that would wait for that size page on High speed let alone dial up. Definatley optimize the images and decrease the size to about 50Kb or less and allow previewing of them render the image as a link that will allow them to load the larger image in another floating dive layer
Apr 25 '07 #3
blobb
12
i have optimised them, so now they are about 5 mb heavy.

what does the float divs mean? what is the difference between invisible?
Apr 27 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: MALdito | last post by:
hi everybody let me say right from the start .. I´m not a coder ... "just" a designer! that said .. here is my question: I´m using dreamweaver´s built in preloader for a menu. it looks like...
3
by: Bob | last post by:
I usually use some "pre-load" code in my pages to preload graphics that will be swapped. But, I'm thinking that rather than the long, repetitive, once, for each graphic hardcoded stuff like this: ...
2
by: jmhill | last post by:
Has anyone else had this issue? Basically, the preload of images for a rollover effect for the navigation is really really slow when using IE 6.0 but when i view the site using Netscape, it's fast...
2
by: Albert Spencil | last post by:
I have tried several preload scripts found here; plus, some of my own. The only thing that works is the unsophisticated loading of those tiny images. The download consist of 100+ images amounting...
1
by: Stacey | last post by:
Hi, I'm hoping for a bit of advise-- I have a (relatively, from the point-of-view of this dilettante) complex script that attempts to preload certain images in order to trigger one of a series of...
4
by: shapper | last post by:
Hello, I think to preload an image I should us something like: img = new Image(); img.src = 'images/img.jpg'; Could someone tell me how to create a loop which would preload a list of...
4
by: shapper | last post by:
Hello, I am working in Asp.Net 2.0 web sites and I need to preload some images in my master pages and in the pages that use those master pages. Could someone tell me how to do this? Thanks,...
9
by: shapper | last post by:
Hello, How can I preload a few images of a page javascript? Should I use CSS to do this? Is it even possible? Thanks, Miguel
2
by: matt9807 | last post by:
The following is a script that I have written that preloads images for an image gallery. The problem is that the images only preload in Safari, other browsers load each image when it is called. Any...
3
by: Revathi Balakrishnan | last post by:
Hi i have the used the below code to switch the button image on mouseover and mouseout. <html:button property="Button" value="Display" styleClass="displaybutton" ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.