/    Sign up×
Community /Pin to ProfileBookmark

Is there another way to make a slideshow with a couple of gif images exept for using timeout?

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@Warren86Mar 23.2005 — A simple image pager:

<HTML>

<Head>

<Script Language=JavaScript>

// image file names are consecutive numbers, e.g. 1.jpg, 2.jpg, 3.jpg

var nImgs = 6; // number of images
var curr = 1;

function turnPage(direction){

if (direction == 'next'){if (curr < nImgs){curr++} else{curr = 1}}
if (direction == 'prev'){if (curr > 1){curr--} else{curr = nImgs}}
document.getElementById('slideImg').src = curr+".jpg";
}


</Script>

</Head>

<body>

<table border="0" cellpadding="0" align='center'>

<TR>

<TD><Img Src='1.jpg' width=640 height=480 id='slideImg'></TD>

</TR>

<TR>

<TD align='center'><br><input type=button value="Prev" onClick="turnPage('prev')">&nbsp;&nbsp

<input type=button value="Next" onClick="turnPage('next')"></TD>

</TR>

</table>

</body>

</html>
×

Success!

Help @gebezis 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.15,
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,
)...