DIV / layers

liunx

Guest
Following advice here (thanks Adam) I am using DIV tags instead of tables to lay out my page.<br />
<br />
BUT - the graphics in the layers seem to load really slowly compared with graphics not in layers. Why is it?<br />
<br />
To show what I mean, look at these two links<br />
<br />
<!-- m --><a class="postlink" href="http://www.netcartoon.net/index1.htm">http://www.netcartoon.net/index1.htm</a><!-- m --><br />
<br />
<br />
<!-- m --><a class="postlink" href="http://www.netcartoon.net/idea1.jpg">http://www.netcartoon.net/idea1.jpg</a><!-- m --><br />
<br />
<br />
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.<br />
<br />
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?<br />
<br />
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.<br />
<br />
Thanks a lot.<br />
<br />
Toby<!--content-->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????<!--content-->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.<br />
<br />
Yes, put up sample pages using the same layout, one in divs and one in tables. There should be little difference in Download <!--more--> time.<br />
<br />
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).<br />
<br />
Adam<!--content-->I've put up two links with tables and layers - exactly the same image but different names, so caching won't skew it.<br />
<br />
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 <!--more--> the images again even if I clear history etc..<br />
<br />
<br />
<br />
Layers (<!-- m --><a class="postlink" href="http://www.netcartoon.net/test/layers.htm">http://www.netcartoon.net/test/layers.htm</a><!-- m -->)<br />
<br />
Tables (<!-- m --><a class="postlink" href="http://www.netcartoon.net/test/table.htm">http://www.netcartoon.net/test/table.htm</a><!-- m -->) <br />
<br />
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.<br />
<br />
Thanks anyway.<!--content-->I get no speed difference between the two - I'm using Mozilla 1.3, Win 98, ADSL connection.<br />
<br />
Adam<!--content-->That's good to know. Must be at my end. Thanks<!--content-->The script that can time the page rendering was discussed here: <!-- m --><a class="postlink" href="http://forums.webdeveloper.com/showthread.php?s=&threadid=5354">http://forums.webdeveloper.com/showthre ... eadid=5354</a><!-- m --><br />
It will give an objective number that won't depend on Download <!--more--> speed.<!--content-->thanks vladdy - thats a good tip<!--content-->I didn't see any difference in the speed between the tables and layers.<!--content-->
 
Back
Top