/    Sign up×
Community /Pin to ProfileBookmark

Please help with Javascript

I’m trying to use some JS code I downloaded. The code is used to make it so I can scroll through images in a browser by clicking on buttons. I try to change the the input type so that the buttons display as images I use instead of using standard buttons, but when I do that the whole thing stops working completely. Can someone help me?
—————————————————————

<table border=”0″ cellpadding=”0″>
<caption><strong>Air Show Photos</strong></caption>
<tr>
<td width=”100%”><img src=”plane1.gif” width=”300″ height=”240″ name=”photoslider”></td>
</tr>
<tr>
<td width=”100%”><form method=”POST” name=”rotater”>
<div align=”center”><center><p><script language=”JavaScript1.1″>
var photos=new Array()
var which=0

/*Change the below variables to reference your own images. You may have as many images in the slider as you wish*/
photos[0]=”plane1.gif”
photos[1]=”plane2.gif”
photos[2]=”plane3.gif”
photos[3]=”plane4.gif”
photos[4]=”plane5.gif”

function backward(){
if (which>0){
window.status=”
which–
document.images.photoslider.src=photos[which]
}
}

function forward(){
if (which<photos.length-1){
which++
document.images.photoslider.src=photos[which]
}
else window.status=’End of gallery’
}
</script><input type=”button” value=”&lt;&lt;Back” name=”B2″
onClick=”backward()”> <input type=”button” value=”Next&gt;&gt;” name=”B1″
onClick=”forward()”><br>
<a href=”#” onClick=”which=1;backward();return false”><small>Start Over</small></a></p>
</center></div>
</form>
</td>
</tr>
</table>

<p align=”center”><font face=”arial” size=”-2″>This free script provided by</font><br>
<font face=”arial, helvetica” size=”-2″><a href=”http://wsabstract.com”>Website

Abstraction</a></font></p>
————————————————

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@brendandonhueJul 13.2003 — Change

<input type="button" value="&lt;&lt;Back" name="B2"

onClick="backward()"> <input type="button" value="Next&gt;&gt;" name="B1"

onClick="forward()">

to

<img src="back.gif" name="B2"

onClick="backward()"> <img src="forward.gif" name="B1"

onClick="forward()">

and it should work.
Copy linkTweet thisAlerts:
@eldritchknightauthorJul 13.2003 — It worked, thank you very much :-)
Copy linkTweet thisAlerts:
@brendandonhueJul 13.2003 — You're Welcome
×

Success!

Help @eldritchknight 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.27,
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,
)...