singingdoughnut Posted December 2, 2007 Share Posted December 2, 2007 Hi Im currently trying have images move to one side, while the page shows three images. When one moves, the others move with it. An alert displays what is needed, but the actual code will only work with one image. Javascript code: var maxThumbnails = imgArray.length; var thumbnailIndex = 0; function next(){ //get Julian's help thumbnailIndex++; if (thumbnailIndex >= imgArray.length) { thumbnailIndex = 0; } var index = thumbnailIndex; for (var i = 0; i < maxThumbnails; i++) { //alert(imgArray[index]); index++; nextImg() //document.images.rollimg.src = imgArray[thumbnailIndex] if (index >= imgArray.length) { index = 0; document.images.rollimg.src = imgArray[thumbnailIndex] //nextImg() } } } Here is the Html Code: function displayThumbnails($ni) { $images = scandir($ni); $length = count($images); $maxTM = 5; $one = 3; if ($length < $maxTM){ $maxTM = $length; } //this smells for ($i = 2; $i < $maxTM; $i++){ $img = $images[$i]; echo "<img src=\"$ni$img\" name = \"rollimg\" /> "; } } // Displays the category headings echo "<div id = \"heading\">"; echo "<h1>" . $category . "</h1>"; echo "</div>"; echo "<div id = \"category\"><ul>"; displayCategories("gallery/"); echo "</ul></div>"; echo "<button onClick = \"previousImg()\">Previous</button>"; displayThumbnails("gallery/$category/small/"); echo "<button onClick = \"next()\" name = \"next\">Next</button>"; Its not all the code, but that is just the main problem. Link to comment https://forums.phpfreaks.com/topic/79799-need-help-with-slideshow-displaying-3-thumbnails/ Share on other sites More sharing options...
phpQuestioner Posted December 2, 2007 Share Posted December 2, 2007 check out some of these search results; they may give you an idea on how to do what your wanting to do: http://www.google.com/search?hl=en&q=conveyor+belt+slideshow&btnG=Google+Search Link to comment https://forums.phpfreaks.com/topic/79799-need-help-with-slideshow-displaying-3-thumbnails/#findComment-404250 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.