Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript_howto thread: Change an image


Message #1 by "Carmen Shields" <cshields@m...> on Mon, 12 Aug 2002 21:41:06
I am using FrontPage 2000. The goal I am trying to achieve is to have one 
big image with three or four thumbnails underneath or beside it (all 
preloaded). When you mouseover a thumbnail, it changes the big image and 
stays on that image until you mouseover another thumbnail.

I keep getting an error that 'document.picture' is null or not an object.

I am an idiot with stuff (hence FrontPage), but I really want this to 
work... here is the code, any help would be GREATLY appreciated.

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Ceramic Tile Bathrooms</title>
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta name="Microsoft Border" content="tl, default">

<SCRIPT LANGUAGE="JavaScript">

<!--Begin

var ErmitageLarge = new Image();
var ErmitageSmall = new Image();
var AntiquaLarge = new Image();
var AntiquaSmall = new Image();
var EmpireLarge = new Image();
var EmpireSmall = new Image();
var ItaparicaLarge = new Image();
var ItaparicaSmall = new Image();

ErmitageLarge.src = "ermitage-large.jpg";
ErmitageSmall.src = "ermitage-small.jpg";
AntiquaLarge.src = "antiqua-large.jpg";
AntiquaSmall.src = "antiqua-small.jpg";
EmpireLarge.src = "empire-large.jpg";
EmpireSmall.src = "empire-small.jpg";
ItaparicaLarge.src = "itaparica-large.jpg";
ItaparicaSmall.src = "itaparica-small.jpg";

function doButtons(picimage){
eval("document['picture'].src = " + picimage + ".src");
}
// End-->
</script>

</head>

<body stylesrc="index.htm">
<center>
<table border=1 width="511">
<tr><td width="171">
<center><h2>Places I've been:</h2></center>
<p>
<li><a href 
= "http://www.mosaictileco.com/ceramic_tile_manufacturers/keraben/ermitage
.html" onmouseover = "doButtons('ErmitageLarge')">Ermitage<p>

<li><a href 
= "http://www.mosaictileco.com/ceramic_tile_manufacturers/Lord/Antiqua.htm
l" onmouseover = "doButtons('AntiquaSmall')">Antiqua<p>

<li><a href = "http://www.crossville-ceramics.com" onmouseover 
= "doButtons('EmpireSmall')">Empire<p>

<li><a href 
= "http://www.mosaictileco.com/ceramic_tile_manufacturers/portobello/itapa
rica.html" onmouseover = "doButtons('ItaparicaSmall')">Itaparica<p>


<td width="324">
<img border="0" src="blank.gif" width="100" height="100"></td>
</tr>
</table>
</center>

<p><center>

<p>
</body>

</html>


Thank you very much,

Carmen

  Return to Index