HTML and CSS Reference
In-Depth Information
window
document
images[0] images[1] images[...]
Figure 12.2 Document object and images.
For preloading offscreen images, JavaScript provides an image constructor (see
Example 12.6). The constructor is used if you have large images that will take time to
download or images that are being replaced dynamically within the page. The images are
preloaded into memory (but not displayed) and available from the cache when the user
requests them, thus making the response time much faster (see Example 12.4).
Table 12.2 image Object Properties
Property
HTML <img>
Attribute
Description
border
border
An integer value determining the width of an image border in pixels.
complete
A Boolean value returning true if Navigator has finished
downloading the image.
height
height
An integer representing the height of the image in pixels.
hspace
hspace
An integer representing the horizontal space (pixels) around the
image.
lowsrc
lowsrc
Specifies an optional image to display for a low-resolution device.
name
name
A string containing the name of the image.
prototype
Used to add user-specified properties to an image object.
src
src
A string containing the path and name of the image.
vspace
vspace
An integer representing the vertical space (pixels) around the image.
width
width
An integer representing the width of the image in pixels.
12.2 Reviewing Links
Links are fundamental to the Web. They are primarily used to navigate you from page
to page. We have been using links in many examples so far. There are a number of ways
to execute JavaScript from a link such as navigating to another page, opening a link in
 
 
Search WWH ::




Custom Search