Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 04-09-2009, 08:15 PM   PM User | #1
cscwebmaster
New Coder

 
Join Date: Apr 2009
Posts: 12
Thanks: 4
Thanked 0 Times in 0 Posts
cscwebmaster is an unknown quantity at this point
image gallery + javascript

resolved

Last edited by cscwebmaster; 04-11-2009 at 01:04 PM.. Reason: resolved
cscwebmaster is offline   Reply With Quote
Old 04-09-2009, 09:17 PM   PM User | #2
Philip M
Supreme Master coder!

 
Philip M's Avatar
 
Join Date: Jun 2002
Location: London, England
Posts: 17,100
Thanks: 197
Thanked 2,421 Times in 2,399 Posts
Philip M has a spectacular aura aboutPhilip M has a spectacular aura aboutPhilip M has a spectacular aura about
This should get you started:-

Code:
<center>
<td align="center" width="100%"><img src="One.gif" style="width:80px;height:80px" name="photoslider"></td>
</tr>

<tr>
<td width="100%">
<div align="center">

<script type= "text/javascript">

var photos=new Array();
var which=0;

photos[0]="One.gif"
photos[1]="Two.gif"
photos[2]="Three.gif"
photos[3]="Four.gif"
photos[4]="Five.gif"
photos[5]="Six.gif"

function backward(){
if (which>0){
window.status='';
which-- ;
document.photoslider.src=photos[which];
}
}

function forward(){
if (which<photos.length-1){
which++ ;
document.photoslider.src=photos[which];
}
else window.status='End of gallery';
}

</script>

<br>
<input type="button" value="&lt;&lt; Back" name="B2" onClick="backward()"> &nbsp &nbsp <input type="button" value="Next &gt;&gt;" name="B1" onClick="forward()"><br><br>

<a href="#" onClick="which=1;backward();return false"><font face="Arial, Helvetica" color="#0000FF"><small><b>Go back to the start</b></small></a></p>
      
<a href="#" onClick="which=photos.length-2; forward();return false"><font face="Arial, Helvetica" color="#0000FF"><small><b>Go to the last image</b></small></a></p>

</center></div>
If you use the search feature of this forum you will find several other excellent examples.


"Why should I do anything for posterity? What has posterity ever done for me?" - Groucho Marx (1890 - 1977)
Philip M is offline   Reply With Quote
Reply

Bookmarks

Tags
gallery, javascript, photo

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:07 AM.


Advertisement
Log in to turn off these ads.