PHP interesse |
|
Bovenstaande oplossing werkte niet.
Op deze manier heb ik het opgelost:
<script language="JavaScript1.1">
var photos=new Array()
var which=0;
var map="afbeeldingen/jpg/";
/*Change the below variables to reference your own images. You may have as many images in the slider as you wish*/
photos[0]=map+"dia1.jpg";
photos[1]=map+"dia2.jpg";
photos[2]=map+"dia3.jpg";
photos[3]=map+"dia4.jpg";
photos[4]=map+"dia5.jpg";
photos[5]=map+"dia6.jpg";
function previousImage(){
if (which>0){
window.status=''
which--
document.images.photoslider.src=photos[which];
thisphoto=document.getElementById('dezefoto');
thisphoto.innerHTML=which+1;
setTimeout(dezefoto, 1000);
}}
function nextImage(){
if (which<photos.length-1){
which++
document.images.photoslider.src=photos[which];
thisphoto=document.getElementById('dezefoto');
thisphoto.innerHTML=which+1;
setTimeout(dezefoto, 1000);
}
else window.status='End of gallery'
}
var totalphoto=photos.length;
</script>
<script language="JavaScript1.1"> var photos=new Array() var which=0; var map="afbeeldingen/jpg/"; /*Change the below variables to reference your own images. You may have as many images in the slider as you wish*/ photos[0]=map+"dia1.jpg"; photos[1]=map+"dia2.jpg"; photos[2]=map+"dia3.jpg"; photos[3]=map+"dia4.jpg"; photos[4]=map+"dia5.jpg"; photos[5]=map+"dia6.jpg"; function previousImage(){ if (which>0){ window.status='' which-- document.images.photoslider.src=photos[which]; thisphoto=document.getElementById('dezefoto'); thisphoto.innerHTML=which+1; setTimeout(dezefoto, 1000); }} function nextImage(){ if (which<photos.length-1){ which++ document.images.photoslider.src=photos[which]; thisphoto=document.getElementById('dezefoto'); thisphoto.innerHTML=which+1; setTimeout(dezefoto, 1000); } else window.status='End of gallery' } var totalphoto=photos.length; </script>
en in HTML+PHP:
<table>
<td width="100%" align="center" valign="middle">
<span id="dezefoto">1</span>/<script language="JavaScript">document.write(totalphoto);</script><br>
<img src="afbeeldingen/jpg/dia1.jpg" width="300" height="347" name="photoslider">
</td>
<tr>
<td width="100%" align="center" valign="middle">
<form method="POST" name="rotater">
<div align="center"><center><p>
<input type="button" class="photobuttons" value="« Vorige" name="B2" onClick="previousImage()">
<input type="button" class="photobuttons" value="Start" name="B3" onClick="which=1;previousImage();return false">
<input type="button" class="photobuttons" value="Volgende »" name="B1" onClick="nextImage()"><br>
</p></center></div>
</form>
</td>
</tr>
</table>
<table> <td width="100%" align="center" valign="middle"> <span id="dezefoto">1</span>/<script language="JavaScript">document.write(totalphoto);</script><br> <img src="afbeeldingen/jpg/dia1.jpg" width="300" height="347" name="photoslider"> </td> <tr> <td width="100%" align="center" valign="middle"> <form method="POST" name="rotater"> <div align="center"><center><p> <input type="button" class="photobuttons" value="« Vorige" name="B2" onClick="previousImage()"> <input type="button" class="photobuttons" value="Start" name="B3" onClick="which=1;previousImage();return false"> <input type="button" class="photobuttons" value="Volgende »" name="B1" onClick="nextImage()"><br> </p></center></div> </form> </td> </tr> </table>
|