Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Repeating Dynamic image (php) in an array

Status
Not open for further replies.

jmxfield

Programmer
Jan 14, 2009
1
US
Hi, I am very very new to javascript and know even less about arrays. I am trying to repeat an image from a recordset in this gallery. My code below shows only the first image from the record set, how would I go about getting this to repeat all records from the record set. Many thanks.

<code>

<script type="text/javascript">

var mygallery=new simpleGallery({
wrapperid: "simplegallery1", //ID of main gallery container,
dimensions: [250, 180], //width/height of gallery in pixels. Should reflect dimensions of the images exactly
imagearray: [
["<?php
echo tNG_showDynamicImage("", "images/ClubListing_Pics/", "{rsClubPics.ImageFile}");?>", " "_new"],

],
autoplay: true,
persist: false,
pause: 2500, //pause between slides (milliseconds)
fadeduration: 500, //transition duration (milliseconds)
oninit:function(){ //event that fires when gallery has initialized/ ready to run
},
onslide:function(curslide, i){ //event that fires after each slide is shown
//curslide: returns DOM reference to current slide's DIV (ie: try alert(curslide.innerHTML)
//i: integer reflecting current image within collection being shown (0=1st image, 1=2nd etc)
}
})

</script>
</code>
 
If you want to know how to loop over a PHP recordset, then you should ask in forum434.

If you want the 'imagearray' property of 'mygallery' to have more than one item, the general syntax would be:

Code:
imagearray: [ someItem1, someItem2, ... someItemN ]

I don't know how your recordset looks, so that's why I'd advise the PHP forum for info on how to iterate over that.

Hope this helps,
Dan



the PHThis sounds like more of a PHP quest

Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page [blue]@[/blue] Code Couch:
Code Couch Tech Snippets & Info:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top