Author Topic: Various HTML & CSS questions  (Read 4596 times)

Offline Chris

  • Game Owner
  • Level 35
  • *
  • Posts: 2,217
  • Reputation: +28/-1
    • View Profile
Re: Various HTML & CSS questions
« Reply #25 on: August 18, 2011, 05:22:25 AM »
Thanks, but I already did it (I even managed to forget already how I did it... :))

But I still have a question about the "delayed display" http://community.bbgamezone.net/web-design-graphics/various-html-css-questions/msg22909/#msg22909 if you have ideas, please post.

Offline BlackScorp

  • Level 15
  • *
  • Posts: 123
  • Reputation: +6/-0
    • View Profile
    • Cruel Online
Re: Various HTML & CSS questions
« Reply #26 on: September 02, 2011, 08:19:49 AM »
Works, but you have to add the "http://www.w3.org/TR/html4/loose.dtd" part, I always thought it was optional and just the doctype core definition "<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">" is enough...

BTW it does not work in IE6 (not that it's surprising...), do you know if it works at least in IE7?



[HTML/PHP/Network] "delayed" display

A simple map (table and divs with content inside each cell). When I test it on localhost everything displays fast and flawlessly. When I do it on live server it renders it slooooow and I can see the tiles of the map being displayed separately. Why?

The whole map is displayed using just one echo. But assuming network latency blah, blah, blah I made another version which uses ob. That one should send everything at once to the browser (except css), right? So how could it display different way than on local host? I could imagine the whole map being displayed slower, but not its parts!

http://worldoflords.com/misc/test/pnwmap/index.php
http://worldoflords.com/misc/test/pnwmap/index-ob.php

i had this problem in the past and i could solve it in 3 ways.

1. Sprite Map
on loading the HTML page you load a Sprite map with all images at once so you see all tiles at once

OR

2. Preload Images with javascript
use
var imageList = new Array();
imageList[0] = 'path/to/image1.jpg';
imageList[1] = 'path/to/image2.jpg';
...

for(var i in imageList){
var tile = new Image();
tile.src = imageList;
}

OR

3. put in your html Code the images with widh=0 and height=0 or css visiblity:hidden before displaying your map. that should fix to display your tiles separately

Greetz

Offline Chris

  • Game Owner
  • Level 35
  • *
  • Posts: 2,217
  • Reputation: +28/-1
    • View Profile
Re: Various HTML & CSS questions
« Reply #27 on: September 02, 2011, 11:44:05 AM »
1. Sprite Map
OR
2. Preload Images with javascript
No. It is not a problem with images. If this was about images the problem would appear only the first time the image is displayed (because then it gets cached). But it appears all the time, no matter how much you move around the map. It seems like a problem with the "HTML speed over network".

 


SimplePortal 2.3.3 © 2008-2010, SimplePortal