Code:
// JavaScript Document
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Javascript onmouseover slideshow</title>
<style type="text/css">
.thumb
{
width: 80px;
height: 60px;
}
#scripttable {
position: absolute;
background: #eeeeee;
top: 10px;
left: 0px;
display: none;
}
</style>
</head>
<body>
<div id="imagediv" align="center"> <img src="images/foto0.jpg" name="mainimage" width="800" height="600" vspace="5"> </div>
<div id="thumbsdiv" align="center"> <img src="images/foto0.jpg" class="thumb" onMouseOver="javascript:changeimage(0);"> <img src="images/foto1.jpg" class="thumb" onMouseOver="javascript:changeimage(1);"> <img src="images/foto2.jpg" class="thumb" onMouseOver="javascript:changeimage(2);"> <img src="images/foto3.jpg" class="thumb" onMouseOver="javascript:changeimage(3);"> <img src="images/foto4.jpg" class="thumb" onMouseOver="javascript:changeimage(4);"> <img src="images/foto5.jpg" class="thumb" onMouseOver="javascript:changeimage(5);"> <img src="images/foto6.jpg" class="thumb" onMouseOver="javascript:changeimage(6);"> <img src="images/foto7.jpg" class="thumb" onMouseOver="javascript:changeimage(7);"> <img src="images/foto8.jpg" alt="" class="thumb" onMouseOver="javascript:changeimage(8);"> <img src="images/foto9.jpg" alt="" class="thumb" onMouseOver="javascript:changeimage(9);"> <img src="images/foto10.jpg" alt="" class="thumb" onMouseOver="javascript:changeimage(10);"> <img src="images/foto11.jpg" alt="" class="thumb" onMouseOver="javascript:changeimage(11);"> </div>
<div id="likediv" align="center">
<table width="50%">
<tr>
<td align="center" width="25%"><a href="./" title="Index">Index</a></td>
<td align="center" width="25%"><a href="javascript:void(0);" onMouseDown="javascript:script(1);">Script</a></td>
<td align="right" width="25%"><iframe src="http://www.facebook.com/widgets/like.php?layout=button_count&show_faces=false&href=http%3A%2F%2Fwww.jemimaja.be%2Fhelped%2Fslideshow_onmouseover.html" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:150px; height:20px;" allowtransparency="true"></iframe></td>
<td align="center"><a href="../../" title="My website">Website</a></td>
</tr>
</table>
</div>
<table id="scripttable" width="800" cellpadding="10">
<tr>
<td><html><br>
<head><br>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><br>
<title>Javascript onmouseover slideshow</title><br>
<style type="text/css"><br>
#thumb {<br>
width: 80px;<br>
height: 60px;<br>
}<br>
</style><br>
<script language="javascript" type="text/javascript"><br>
<!--<br>
function changeimage(nnum) {<br>
document.mainimage.src = "images/foto" + nnum + ".jpg";<br>
};<br>
--><br>
</script><br>
</head><br>
<body><br>
<div id="imagediv" align="center"> <img src="images/foto0.jpg" name="mainimage" width="800" height="600" vspace="5"> </div><br>
<div id="thumbsdiv" align="center"> <img src="images/foto0.jpg" class="thumb" onMouseOver="javascript:changeimage(0);"> <img src="images/foto1.jpg" class="thumb" onMouseOver="javascript:changeimage(1);"> <img src="images/foto2.jpg" class="thumb" onMouseOver="javascript:changeimage(2);"> <img src="images/foto3.jpg" class="thumb" onMouseOver="javascript:changeimage(3);"> <img src="images/foto4.jpg" class="thumb" onMouseOver="javascript:changeimage(4);"> <img src="images/foto5.jpg" class="thumb" onMouseOver="javascript:changeimage(5);"> <img src="images/foto6.jpg" class="thumb" onMouseOver="javascript:changeimage(6);"> <img src="images/foto7.jpg" class="thumb" onMouseOver="javascript:changeimage(7);"> <img src="images/foto8.jpg" alt="" class="thumb" onMouseOver="javascript:changeimage(8);"> <img src="images/foto9.jpg" alt="" class="thumb" onMouseOver="javascript:changeimage(9);"> <img src="images/foto10.jpg" alt="" class="thumb" onMouseOver="javascript:changeimage(10);"> <img src="images/foto11.jpg" alt="" class="thumb" onMouseOver="javascript:changeimage(11);"> </div><br>
<body><br>
<html> </td>
</tr>
<tr>
<td align="center"><a href="javascript:void(0);" onMouseDown="javascript:script(0);">Close</a></td>
</tr>
</table>
<script language="javascript" type="text/javascript">
<!--
document.getElementById("scripttable").style.left = (document.all) ? (window.document.body.clientWidth-798)/2 : (window.innerWidth-800)/2;
function changeimage(nnum) {
document.mainimage.src = "images/foto" + nnum + ".jpg";
};
function script(nnum) {
document.getElementById("scripttable").style.display = (nnum == 1) ? "block" : "none";
};
-->
</script>
</body>
</html>
hier zit de foutwidth: 80px;
ik snap er helemaal niks van
op die site waar ik die code vandaan heb werkt die perfect
verder... ik wil deze javascript aanroepen en centreren... hoe krijg ik hem gecentreerd ? gewoon <center> bestand aanroepen </center?