/    Sign up×
Community /Pin to ProfileBookmark

Need help with photo descriptions in gallery.

I have a problem getting a photo description to display under the corresponding photo when “previous” “auto/stop” “next” are clicked. So far I can only swith between photos but with no description. I have a side navigation that switches out layers(show/hide). And each layer has it’s own “previous” “auto/stop” “next” navigation to show the array of photos. But I cannot find a way to display the photos description. Here is a sample of the code I am using. In the full code there are 5 layers. Can anyone please help me. I’ve been at this for 2 weeks ? . My thanks in advance. ?

<html>

<head>

<meta http-equiv=”Content-Type” content=”text/html; charset=ISO-8859-1″>

<title>Untitled Document</title>

<SCRIPT LANGUAGE=”JavaScript”>

Img1 = new Array (8);
Img1[0] = “images/1.jpg”;
Img1[1] = “images/2.jpg”;
Img1[2] = “images/3.jpg”;
Img1[3] = “images/4.jpg”;
Img1[4] = “images/5.jpg”;
Img1[5] = “images/6.jpg”;
Img1[6] = “images/7.jpg”;
Img1[7] = “images/8.jpg”;

var ImgNum1 = 0;
var ImgLength1 = Img1.length – 1;

//Time delay between Slides in milliseconds
var delay = 3000;

var lock = false;
var run;

function chgImg1(direction) {
if (document) {
ImgNum1 = ImgNum1 + direction;
if (ImgNum1 > ImgLength1) {
ImgNum1 = 0;
}
if (ImgNum1 < 0) {
ImgNum1 = ImgLength1;
}
document.slideshow1.src = Img1[ImgNum1];
}
}

function auto1() {
if (lock == true) {
lock = false;
window.clearInterval(run);
}
else if (lock == false) {
lock = true;
run = setInterval(“chgImg1(1)”, delay);
}
}
</script>

</head>

<body>

<div id=”Layer1″>
<table width=”400″ border=”0″ cellspacing=”0″ cellpadding=”0″>
<tr>
<td><center>
<img src=”images/1.jpg” name=”slideshow1″ width=”400″ height=”361″>
<table>
<tr>
<td align=”right”><a href=”javascript:chgImg1(-1)”>Previous</a></td>
<td align=”center”><a href=”javascript:auto1()”>Auto/Stop</a></td>
<td align=”left”><a href=”javascript:chgImg1(1)”>Next</a></td>
</tr>
</table>
</center></td>
</tr>
</table>
</div>

</body>
</html>

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @smog 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 6.17,
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: @nearjob,
tipped: article
amount: 1000 SATS,

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

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...