/    Sign up×
Community /Pin to ProfileBookmark

newbie needs help

It may a bit optimistic to even call myself a javascript newbie. I really know very little javascript, nonetheless I’m trying to help a photgrapher friend get a portfolio site up that uses a little. Here’s an example page:
[url]http://www.mikebrownimages.com/editorial.htm[/url]

The problem I’m having is when the user switches from left hand navigation to the buttons on the lower right, the image may not load at all. Meanwhile both forms of navigation work smoothly independent of one another. I got the script for the forward/back buttons off of the web and a friend helped me to refine it a little. He and several others have looked at the code and can’t figure out what the problem is.

I’d appreciate any help y’all can give me, thanks.

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@FangMay 11.2005 — Both slide show menus appear to work correctly.
Copy linkTweet thisAlerts:
@durgidogauthorMay 11.2005 — The menus work well independent of one another, but if you switch from the left hand nav to the forward/back buttons on the lower right, the buttons stop functioning correctly. Particularly when you've clicked an image toward the bottom of the table on the left. The code for the forward/back buttons is:

which_image_loaded = 0;

NUMBER_OF_IMAGES = 20;

ImageNames = new Array;

ImageNames.length = NUMBER_OF_IMAGES - 1;

for (counter = 0; counter < NUMBER_OF_IMAGES; counter++){

file_number = counter + 1;

filename = ("images/EditorialC/" + file_number + ".jpg");

ImageNames[counter] = filename;

}

function changeImage(direction) {

//alert(which_image_loaded);

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;

document.myimage.src = ImageNames[which_image_loaded];

}


Any ideas? Thanks in advance and sorry for the "newbie" thread title, stupidly, I read the FAQ after posting.
×

Success!

Help @durgidog spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...