User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 423,384 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,766 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 1061 | Replies: 0
Reply
Join Date: Apr 2007
Posts: 257
Reputation: greeny_1984 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 10
greeny_1984's Avatar
greeny_1984 greeny_1984 is offline Offline
Posting Whiz in Training

image gallery help

  #1  
Aug 8th, 2007
hi everyone,
i doing an application on image gallery in which i have an thumbnails of pics and a big image .when ever i click on the thumbnail image it should be displayed in the big image and there are previous and next buttons aslo.iam using the following code,it is working fine when i never click on the thumbnails of images but when i click on the thumbnails in a ramdom way ,the prev and next buttons r not working in a corrext manner.Can any one say wats wrong in my code and how to improve it.waiting for u r reply
function funcdisplay(n)
{
if (document.images)
document.getElementById("myimage").src= "images"+"/" + "image" + n + ".jpg";
}
which_image_loaded = 0;
NUMBER_OF_IMAGES = 6;
ImageNames = new Object();
ImageNames.length = NUMBER_OF_IMAGES - 1;
var imagenumber
index=0;

for (counter = 0; counter < NUMBER_OF_IMAGES; counter++){
file_number = counter + 1;
filename = ("images"+"/" + "image" + file_number + ".jpg");
ImageNames[counter] = filename;
}
function changeImage(direction) {
which_image_loaded += direction;
if (which_image_loaded < 0)
which_image_loaded =NUMBER_OF_IMAGES - 1 ;
if (which_image_loaded == NUMBER_OF_IMAGES)
which_image_loaded = 0;
if (document.images)
document.myimage.src = ImageNames[which_image_loaded];
}
<inputtype="button"value="<<Previous"onClick='changeImage(-1);'/>
<input type="button" value="Next>>" onClick='changeImage(1);' />
AddThis Social Bookmark Button
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb JavaScript / DHTML / AJAX Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum

All times are GMT -4. The time now is 12:49 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC