Nieuw lid |
|
Hee hallo,
Ben bezig met een fotoalbum script, waarmee je door de foto;s kan bladeren zonder dat de gehele pagina reload. Zie gebruikte code
<script language="javascript">
var photos=new Array()
var which=0
/*Change the below variables to reference your own images. You may have as many images in the slider as you wish*/
<?
while ($rows2 = mysql_fetch_object($results2))
{
echo "photos[$foto]=\"nieuws_img/$rows2->foto\"";
$foto = $foto + 1;
}
?>
/*
photos[0]="nieuws_img/8046_1188760028.jpg"
photos[1]="nieuws_img/8491_1188759329.jpg"
photos[2]="nieuws_img/563_1188760031.jpg"
photos[3]="nieuws_img/6258_1188760035.jpg"
photos[4]="nieuws_img/2349_1188760039.jpg"
photos[5]="nieuws_img/195_1188760042.jpg"
photos[6]="nieuws_img/7296_1188805487.jpg"
*/
function backward(){
if (which>0){
window.status=''
which--
document.images.photoslider.src=photos[which]}}
function forward(){
if (which<photos.length-1){
which++
document.images.photoslider.src=photos[which]}
else window.status='End of gallery'}
</script>
<script language="javascript"> var photos=new Array() var which=0 /*Change the below variables to reference your own images. You may have as many images in the slider as you wish*/ <? while ($rows2 = mysql_fetch_object($results2)) { echo "photos[$foto]=\"nieuws_img/$rows2->foto\""; $foto = $foto + 1; } ?> /* photos[0]="nieuws_img/8046_1188760028.jpg" photos[1]="nieuws_img/8491_1188759329.jpg" photos[2]="nieuws_img/563_1188760031.jpg" photos[3]="nieuws_img/6258_1188760035.jpg" photos[4]="nieuws_img/2349_1188760039.jpg" photos[5]="nieuws_img/195_1188760042.jpg" photos[6]="nieuws_img/7296_1188805487.jpg" */ function backward(){ if (which>0){ window.status='' which-- document.images.photoslider.src=photos[which]}} function forward(){ if (which<photos.length-1){ which++ document.images.photoslider.src=photos[which]} else window.status='End of gallery'} </script>
In commentaar heb ik wat foto's gezet, maar dat is natuurlijk niet dynamisch, maar werkt wel... de output van de query is precies hetzelfde maar php en werkt niet. Is dit op een of andere manier toch mogelijk?
Alvast bedankt!
|