A revolving earth (earthani.gif--64x64) Beaverland Net
Net Art
 
Japanese Version (japanv.gif--100x36)

Beaverland Net Art logo (netart2.gif--140x365)

Beaverland Net HTML Made Easy! logo (html02.gif--140x160)

Beaverland Net JavaScript Made Easy! logo (javascrx.gif--140x233)

Beaverland Unlisted Slang logo (slangs2.gif--140x260)

Beaverland Historica logo (histbanr.jpg--140x360)

Beaverland Mythology logo (mythbanr.jpg--140x255)

Beaverland Stries logo (stories.jpg--140x276)

Beaverland Webs & Internet Secrets logo (web100.jpg--140x250)

Beaverland Cleopatra Gallery logo (galleryt.gif--177x275)

Beaverland Ciold War Years logo (coldwrbn.jpg--140x320)


onstore.gif (140x93)

beavbook.gif (120x160)

beavcomp.gif (120x160)

beavmovi.gif (120x160)

beavgift.gif (120x160)

beavtrav.gif (120x160)

music.gif (50x50) Beaverland Music
 
Animation Presentation
with a FORM tag
August 25, 2003

 

1-pixel-by-1 transparent GIF image (spacer.gif--1 x 1)
Hi there!

 

The above animation was originally coded without a FORM tag as follows:

<div style="background-image:url(../images/pinup011.jpg);
    width:472px; height:629px; text-align:left;">
<a href="javascript:alert('Sorry, only this message will
    show up when you click this picture');"
    onMouseOver="displayWink()" onMouseOut="stopAnim()">
<img border="0" name="myGal"
    src="../images/spacer.gif"
    alt="1-pixel-by-1 transparent GIF image"
    width="120" height="120"></a>
</div>
<script language="javascript">
<!---- to hide

var myTimerID=null

 

function displayWink() {
  document.myGal.src="../images/pinup013.jpg"
  myTimerID=setTimeout("displaySpacer()",2000)
  }

function displaySpacer() {
  document.myGal.src="../images/spacer.gif"
  myTimerID=setTimeout("displayWink()",2000)
  }

function stopAnim() {
  clearTimeout(myTimerID)
  document.myGal.src="../images/spacer.gif"
  }

//--->
</script>

You can find the explanation on the above code in this page: Animation Presentation with CSS.   (A new window will open.)

 

The above animation is now coded with a FORM tag as follows:

<div style="background-image:url(../images/pinup011.jpg);
    width:472px; height:629px; text-align:left;">
<img name="myGal"
    src="../images/spacer.gif"
    alt="1-pixel-by-1 transparent GIF image"
    width="120" height="120">

<div style="text-align:right; padding:20px;
    font-weight:bold; font-style:italic;
    font-family:times new roman,cursive;
    font-size:30pt; color:red;">
Hi there!

<form>
<input type="button" value="Start"
  onClick="displayWink()">
<input type="button" value="Stop"
  onClick="stopAnim()">
</form>
</div>
</div>
The Javascript code is exactly the same as that of the above code.

Instead of onMouseOver and onMouseOut, another event handler (onClick) is used with the input tag within the FORM-tag block.

Because you now use the start and stop buttons to control the animation, the anchor tag has been removed from the code.

A nested DIV block defines both the welcome message and the position of the two buttons while the outer DIV block defines the background image of the pinup girl as well as the alignment of the spacer.

You can find the explanation for the Javascript code in the following page: How to reduce an animation-file size with Javascript. (A new window will open up.)

 

For more information, please visit the following links:

 

Related Links





Rate article:
Excellent Good Neutral Poor Worst

Your Name:
Your Email Address:
Comments:


  Comments
 
Tell me how to write CSS code.

    - Don Rodoliguez


You can get the basic information in the CSS table of contents.

    - Akira

 
 
Copyright Akira Kato
About this author:
  • Educated both in Canada and Japan
  • Traveled extensively in Europe, Far East, and North America
  • Worked as management consultant, computer systems analyst, college instructor and freelance writer.
Akira Kato
Amazon Harry Potter Special (amazhar2.jpg--550x280)

Beaverland Forum
Featuring thought-provoking
columns and stories
inserted by FC2 system