August 1999
Intermediate to advanced
1488 pages
72h 53m
English
document.anchors[num].y
The y property contains the y-coordinate of the anchor, in pixels, from the top edge of the document to the anchor.
Listing 7.5 creates a single anchor out of a header at the top of the document. The y property is used to display the vertical position of the Anchor object on the bottom of the page.
<html>
<center><a name="B"><h4>Banana</h4></a></center>
A long, yellow, curved fruit with a soft core.<hr>
<script language="JavaScript">
<!-- Hide
//Display the y property of the anchor
document.write("The y property is equal to ",document.anchors[0].y);
// ---End Hide>
</script>
</html>
|
Read now
Unlock full access