Click to See Complete Forum and Search --> : DIV / layers


tobyw_1969
05-13-2003, 08:54 AM
Following advice here (thanks Adam) I am using DIV tags instead of tables to lay out my page.

BUT - the graphics in the layers seem to load really slowly compared with graphics not in layers. Why is it?

To show what I mean, look at these two links

http://www.netcartoon.net/index1.htm


http://www.netcartoon.net/idea1.jpg


The first is a webpage with some images in <DIV> tags - total size of all images =49k. The second one is a straight .jpg on its own, total size 30k.

But when I view the first one, it takes about 30 seconds to load all the images including rollovers, and the second only takes about 3 seconds. 19k surely can't make that much difference?

Is this a problem with layers, or is it something to do with how I am creating my <DIV> tags? If someone could look at my source code and tell me if I have made a real error i would appreciate it.

Thanks a lot.

Toby

khalidali63
05-13-2003, 12:10 PM
hey how about puttin up a sample page that has the same images in the same layout only one in divs and other in tables????

AdamGundry
05-13-2003, 03:07 PM
This isn't really a realistic comparison, because the first page is a HTML document (which the browser loads, parses, then queries the server for each image) whereas the second is just a JPEG image, whithout HTTP query overhead. Also, image preloading can give slightly misleading results.

Yes, put up sample pages using the same layout, one in divs and one in tables. There should be little difference in download time.

Using divs for layout may be slightly faster, but the main advantages are improved control over the design, better compliance with standards and accessibility guidelines, and easier to maintain pages (no nested <td>s).

Adam

tobyw_1969
05-14-2003, 08:30 AM
I've put up two links with tables and layers - exactly the same image but different names, so caching won't skew it.

I have to say, I couldn't see such a difference today, but I can only look once because my cable provider caches at their end, so refresh doesn't actually make my connection download the images again even if I clear history etc..



Layers (http://www.netcartoon.net/test/layers.htm)

Tables (http://www.netcartoon.net/test/table.htm)

I'm interested to see if anyone can see a difference in speed, but I suspect I may just be paranoid and maybe hit a bad time of day when I first tried the layers page.

Thanks anyway.

AdamGundry
05-14-2003, 09:46 AM
I get no speed difference between the two - I'm using Mozilla 1.3, Win 98, ADSL connection.

Adam

tobyw_1969
05-14-2003, 10:18 AM
That's good to know. Must be at my end. Thanks

Vladdy
05-14-2003, 10:25 AM
The script that can time the page rendering was discussed here: http://forums.webdeveloper.com/showthread.php?s=&threadid=5354
It will give an objective number that won't depend on download speed.

tobyw_1969
05-14-2003, 04:56 PM
thanks vladdy - thats a good tip

Charville
05-14-2003, 08:31 PM
I didn't see any difference in the speed between the tables and layers.