I would like to know if it is possible that a local web page is loaded without images but having a box for each image that is of the same dimensions width/height? Also with Javascript or other techniques.
Asked
Active
Viewed 291 times
1 Answers
0
You need to know the image's dimensions beforehand somehow.
Without loading the image into the browser, that is possible only using server side scripting to fetch the image, get its dimensions, and write the numbers into the markup.
Depending on your use case, you could also load the images using JavaScript, without displaying them, get their dimensions, and update the <img>
elements accordingly. But to do that, the images have to be loaded from the server, and it sounds like that is not what you want.

Pekka
- 442,112
- 142
- 972
- 1,088
-
Can you explicate this javscript loading technique? I can do what you say. – P5music Mar 09 '12 at 13:52
-
@P5 This question has a ready-made function that can find out the size of an image without loading it. http://stackoverflow.com/questions/1944280/determine-original-size-of-image-cross-browser combine that with a method to store the URLs in the document without loading them, and you have what you need – Pekka Mar 09 '12 at 15:51