Image
JavaScript stores images in the images
array of the document
object. A user may create a new image
object as follows:
var new_image = new Image();
This statement creates a new image and sets its src
property to a GIF or JPEG, then preloads that file. See Chapter 4 for more information about images and preloading.
Properties
| FF, IE 4 | Orientation of an image relative to the surrounding text. Values can be: |
| FF, IE 4 |
|
| FF, IE 4 | Size of the border around the image |
Example:
var the_border_size = window.document.my_image.border;
| FF, IE 4 | Read-only: |
Example:
if (window.document.pretty_bird.complete) ...
Get The Book of JavaScript, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.