Soldato
- Joined
- 12 Feb 2006
- Posts
- 17,633
- Location
- Surrey
ok so i have 2 arrays atm one with the images and one with the name of whats in the image, i have a for loop which says
now want i want is that as there is 12 images, which is too much to be shown at once, to make it so that only 4 images are shownand links to other sets of 4 images are then displayed.
now the problem im having is getting it to say for every 4 images, create rouglhy the following:
Back set, 1, 2, 3 etc, next set
and get it so if the user clicks the link it will display the correct set and highlight which set we are on.
im not looking for an exact code for this but a helping hand as to how to go about diong it
[edit]
just thinking about it might have a solution to one problem but still wouldn't sort out pages.. i think. anyway here it is.
thinking would it be good idea to bascially say disaply the first array and 3 more, so like document.write (myArray[number plus 1]) do this 3 times but first says plus 1, second plus 2, third plus 3. then have it so when user clicks next set it jumps 4 arrays and does same thing but with the next 4.
thinking with the page number thing if i was to devide the total array number by 4 rounding up to next whole number and display that many lniks? if that makes sense?
possibly a bad way of doing it but just a thought
Code:
for (i=0;i<fruitImage.length;i++)
{ display image and its correct name }
now the problem im having is getting it to say for every 4 images, create rouglhy the following:
Back set, 1, 2, 3 etc, next set
and get it so if the user clicks the link it will display the correct set and highlight which set we are on.
im not looking for an exact code for this but a helping hand as to how to go about diong it
[edit]
just thinking about it might have a solution to one problem but still wouldn't sort out pages.. i think. anyway here it is.
thinking would it be good idea to bascially say disaply the first array and 3 more, so like document.write (myArray[number plus 1]) do this 3 times but first says plus 1, second plus 2, third plus 3. then have it so when user clicks next set it jumps 4 arrays and does same thing but with the next 4.
thinking with the page number thing if i was to devide the total array number by 4 rounding up to next whole number and display that many lniks? if that makes sense?
possibly a bad way of doing it but just a thought
Last edited: