|
I am learning all sorts of things about changing an already loaded page in amazing (sometimes even practical) ways, but what about controlling the start?
For instance, I can't figure out how (or when) to scale the first appearance of an image using for example:
width="' + the_image.width * zoom_size + '" |
|
Ideally this would allow a simple 2x zoom (which looks fine in higher resolutions) without hard-coding the size of every image.
It would need to be done after the image is preloaded of course. I've tried using document.write() with various annoying results depending on placement (during load, after preloadImages(), in the document body).
The code works except when applying the image properties into the first use of the image itself. Placing the write method in the document body works - after refresh!
How do I call a function, being certain the image is ready, and have document.write() behave (not blanking the page)?
Or is there another way? Or am I just 18,406% better off using one of the more standard page-scaling tactics?
I'm too used to code that flows in order!
|
|
|
|
|
|
|
|