Update Layer

[Total: 0    Average: 0/5]

This updates (NS4 only) a layer dynamically.

Body Code:

NS4 only
Your text here

<!-- position the form layer -->
<! -- let the top value default to the natural position -->
<ILAYER NAME="formlayer" LEFT=50 >

<H3>Please select a flower:</H3>

	<FORM NAME=form1>

		<SELECT name=menu1 onChange="if(isNS4)changeFlower(this.selectedIndex); return false;">
			<OPTION >Mona Lisa Tulip
			<OPTION >Mixed Dutch Tulips
		<OPTION >Bijou Violet


<!-- We have four different layers, each with different info about flowers -->

<!-- position this layer below the form layer -->

<LAYER name="flower0" LEFT=50 width=400 BGCOLOR="#FFFFDD">
	<H3 align="center">Mona Lisa Tulip</H3>

	<IMG src="http://www.js-examples.com/js/pic1.gif"
		align="LEFT" hspace=5 >

	<P>These tulips have been specially designed to withstand late winter frost
	in areas with harsh winters.
	They are a beautiful red color, and we guarantee that they'll grow for at
	least four years in a row.
	Don't wait to order them, they sell fast!</P>

      <BR CLEAR="ALL">

	<P>Priced at only $1 a bulb, they are a bargain.</P>


<LAYER name="flower1" LEFT=50
       width=400 VISIBILITY="HIDE"
	<H3 align = center>Mixed Dutch Tulips</H3>

	<IMG src="http://www.js-examples.com/js/pic1.gif"
		align="LEFT"  hspace=5 >

	<P>These colorful tulips have been specially bred for us by Dr. Hans Tulip in
	He has spent the last ten years perfecting the hybrid. These tulips start
	blooming early, sometimes they beat the crocuses out of the ground! </P>

      <P>They come in a variety of intense colors, and they have a velvety,
	sweet-smelling bloom.</P>

	<P>Priced at $5 for ten, these tulips are a cheap way to bring color to your
	garden. </P>

<LAYER name="flower2" LEFT=50
       width=400 VISIBILITY="HIDE"


	<H3 align ="center">Bijou Violets</H3>
	<IMG src="http://www.js-examples.com/js/pic1.gif" align="LEFT" hspace=5>

	<P>These pale purple African violets are much hardier than most violets. You
	don't need green fingers to keep these flowers thriving!
	Just water them four times a day at regular intervals, and they will thrive

	<P>These flowers are VERY small, the picture has been magnified so you can
	see their shape. The plants usually grow to about an inch high. Thus they make
	excellent indoor plants for tiny apartments. </P>

      <BR CLEAR="ALL">

	<P>The price for these lovely lilac blooms is $4 for a half inch pot, or $10
	for four pots. </P>




// this function hides all the flower layers

function hideAllflowerLayers() {
	document.flower0.visibility = "hide";
	document.flower1.visibility = "hide";
	document.flower2.visibility = "hide";

// this function makes a single flower layer visible
// we have cunningly named the flower layers so we
// can tell which one to show based on the selectedIndex of the menu

function changeFlower(n) {
	document.layers["flower" + n].visibility = "show";


Times Viewed: 5

Leave a Reply

Your email address will not be published. Required fields are marked *