Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 14th, 2005, 01:30 PM
Registered User
Join Date: Dec 2003
Location: , , .
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default Slide Show #1 (New User)

I have a simple photo slide show (rudimentary, but it works).

By pressing "next" & "previous" links on the page, the visitor can move from photo to photo.

I store the photos in an array (called myPix).

Above each slide, I would like the text: Slide 'n' of 'N' (where n = the number of the slide, i.e., its index number + 1; and N = the number of sides in the show, i.e., myPic.length).

Below each slide, I would like to display the name of the slide (for now, the file name of the photo in the array would be good enough).

Can anyone help me get started on this?

Reply With Quote
  #2 (permalink)  
Old March 15th, 2005, 09:58 AM
Friend of Wrox
Join Date: Oct 2004
Location: delhi, delhi, India.
Posts: 553
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to vinod_yadav1919 Send a message via Yahoo to vinod_yadav1919

Hii WebDevel!!
Try this
Just replace the image array imgArray=new Array("img1.gif","img2.gif","img1.gif","img2.gif", "img1.gif","img2.gif")
to whatever you want

<body onload="setImage(1)">

 <input type=button id=first value=" &laquo;&laquo; " onclick="ShowImage(this)">
 <input type=button id=previous value=" &laquo; " onclick="ShowImage(this)">
 <input type=button id=next value=" &raquo; " onclick="ShowImage(this)">
 <input type=button id=last value=" &raquo;&raquo; " onclick="ShowImage(this)"><br>
  <span id="startindex"> </span>Out of <span id="endindex"> </span>Records

<image id="imageid" src="" border=0 >

imgArray=new Array("img1.gif","img2.gif","img1.gif","img2.gif", "img1.gif","img2.gif")
counter=1 //always shows first image from the array
function ShowImage(obj)

else if(whichbtn=="next")
else if(whichbtn=="previous")

else if(whichbtn=="last")


function setImage(indexval)
function setText(x,y)
 document.getElementById("endindex").innerHTML=imgA rray.length
function setButtons(curr_counterx,totalimg)


  document.getElementById("previous").disabled=false ;

if(curr_counterx<totalimg && curr_counterx>1)

  document.getElementById("previous").disabled=false ;

if(curr_counterx==1 && curr_counterx<totalimg)



Hope this will help you

Cheers :)

Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I show user name on our Intranet? sigilaea ASP.NET 2.0 Basics 2 July 12th, 2007 07:30 AM
xslt slide show kawlaelo XSLT 6 February 13th, 2007 10:41 AM
show data for a specific user momo BOOK: Professional ASP.NET 2.0 and Special Edition; ISBN: 978-0-7645-7610-2; ISBN: 978-0-470-04178-9 1 July 17th, 2006 09:08 PM
Image slide-show Rajarshi HTML Code Clinic 1 February 27th, 2006 06:03 AM

All times are GMT -4. The time now is 01:47 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.