webmast3r
03-12-2009, 01:52 PM
the animation doesnt work in this script. cant find the problem-
<html>
<head>
<!--
New Perspectives on JavaScript
Tutorial 5
Tutorial Case
The World of Shakespeare
Author:
Date:
Filename: ws.htm
Supporting files: back1.jps, bio_out.jpg, bio_over.jpg, globe_out.jpg, globe_over.jpg,
logo.gif, plays_out.jpg, plays_over.jpg, scripts.js,
son_out.jpg, son_over.jpg, strat_out.jpg, strat_over.jpg, styles1.css
-->
<title>The World of Shakespeare</title>
<link href="styles1.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
if (document.images) {
varImgOver = new Array();
ImgOver[0] = new Image();
ImgOver[1] = new Image();
ImgOver[2] = new Image();
ImgOver[3] = new Image();
ImgOver[4] = new Image();
ImgOver[0].src = "plays_over.jpg";
ImgOver[1].src = "son_over.jpg";
ImgOver[2].src = "bio_over.jpg";
ImgOver[3].src = "globe_over.jpg";
ImgOver[4].src = "strat_over.jpg";
var ImgOut = new Array();
ImgOut[0] = new Image()
ImgOut[1] = new Image();
ImgOut[2] = new Image();
ImgOut[3] = new Image();
ImgOut[4] = new Image();
ImgOut[0].src = "plays_over.jpg";
ImgOut[1].src = "son_over.jpg";
ImgOut[2].src = "bio_over.jpg";
ImgOut[3].src = "globe_over.jpg";
ImgOut[4].src = "strat_over.jpg";
}
function RollOver(i) {
if (document.images) document.images[i].src = ImgOver[i].src;
}
function RollOut(i) {
if (document.images) document.images[i].src = ImgOut[i].src;
}
</script>
</head>
<body>
<div id="links">
<a href="plays.htm">
<img src="plays_out.jpg" alt="The Plays" onmouseover="RollOver(0)" onmouseout="RollOut(0)" />
</a>
<a href="sonnets.htm">
<img src="son_out.jpg" alt="The Sonnets" onmouseover="RollOver(1)" onmouseout="RollOut(1)" />
</a>
<a href="bio.htm">
<img src="bio_out.jpg" alt="Biography" onmouseover="RollOver(2)" onmouseout="RollOut(2)" />
</a>
<a href="globe.htm">
<img src="globe_out.jpg" alt="The Globe" onmouseover="RollOver(3)" onmouseout="RollOut(3)" />
</a>
<a href="stratford.htm">
<img src="strat_out.jpg" alt="Stratford" onmouseover="RollOver(4)" onmouseout="RollOut(4)" />
</a>
</div>
<div id="main">
<p id="title"><img src="logo.gif" alt="The World of Shakespeare" /></p>
<p id="firstp">The World of Shakespeare contains a complete listing of William
Shakespeare's published works including his plays, sonnets, and longer poems. You can
use the Web site's flexible search tool to locate particular passages and characters
from his works or simply read the plays online or download them to an e-book reader.</p>
<p>For those interested in exploring the world of the bard, download one of our hundreds
of articles on Shakespeare's life and times. You can also download a 3D walkthrough of
the Globe Theatre and view video clips from some of Shakespeare's most popular works.
For those interested in Shakespeare's personal life, take a walking tour of Stratford
and explore his hometown.</p>
</div>
</body>
</html>
<html>
<head>
<!--
New Perspectives on JavaScript
Tutorial 5
Tutorial Case
The World of Shakespeare
Author:
Date:
Filename: ws.htm
Supporting files: back1.jps, bio_out.jpg, bio_over.jpg, globe_out.jpg, globe_over.jpg,
logo.gif, plays_out.jpg, plays_over.jpg, scripts.js,
son_out.jpg, son_over.jpg, strat_out.jpg, strat_over.jpg, styles1.css
-->
<title>The World of Shakespeare</title>
<link href="styles1.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
if (document.images) {
varImgOver = new Array();
ImgOver[0] = new Image();
ImgOver[1] = new Image();
ImgOver[2] = new Image();
ImgOver[3] = new Image();
ImgOver[4] = new Image();
ImgOver[0].src = "plays_over.jpg";
ImgOver[1].src = "son_over.jpg";
ImgOver[2].src = "bio_over.jpg";
ImgOver[3].src = "globe_over.jpg";
ImgOver[4].src = "strat_over.jpg";
var ImgOut = new Array();
ImgOut[0] = new Image()
ImgOut[1] = new Image();
ImgOut[2] = new Image();
ImgOut[3] = new Image();
ImgOut[4] = new Image();
ImgOut[0].src = "plays_over.jpg";
ImgOut[1].src = "son_over.jpg";
ImgOut[2].src = "bio_over.jpg";
ImgOut[3].src = "globe_over.jpg";
ImgOut[4].src = "strat_over.jpg";
}
function RollOver(i) {
if (document.images) document.images[i].src = ImgOver[i].src;
}
function RollOut(i) {
if (document.images) document.images[i].src = ImgOut[i].src;
}
</script>
</head>
<body>
<div id="links">
<a href="plays.htm">
<img src="plays_out.jpg" alt="The Plays" onmouseover="RollOver(0)" onmouseout="RollOut(0)" />
</a>
<a href="sonnets.htm">
<img src="son_out.jpg" alt="The Sonnets" onmouseover="RollOver(1)" onmouseout="RollOut(1)" />
</a>
<a href="bio.htm">
<img src="bio_out.jpg" alt="Biography" onmouseover="RollOver(2)" onmouseout="RollOut(2)" />
</a>
<a href="globe.htm">
<img src="globe_out.jpg" alt="The Globe" onmouseover="RollOver(3)" onmouseout="RollOut(3)" />
</a>
<a href="stratford.htm">
<img src="strat_out.jpg" alt="Stratford" onmouseover="RollOver(4)" onmouseout="RollOut(4)" />
</a>
</div>
<div id="main">
<p id="title"><img src="logo.gif" alt="The World of Shakespeare" /></p>
<p id="firstp">The World of Shakespeare contains a complete listing of William
Shakespeare's published works including his plays, sonnets, and longer poems. You can
use the Web site's flexible search tool to locate particular passages and characters
from his works or simply read the plays online or download them to an e-book reader.</p>
<p>For those interested in exploring the world of the bard, download one of our hundreds
of articles on Shakespeare's life and times. You can also download a 3D walkthrough of
the Globe Theatre and view video clips from some of Shakespeare's most popular works.
For those interested in Shakespeare's personal life, take a walking tour of Stratford
and explore his hometown.</p>
</div>
</body>
</html>