Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Image variable

Status
Not open for further replies.

chadsden

Technical User
Joined
Oct 21, 2000
Messages
4
Location
US
I have a Slide show which consists of an HTML document and an external javascript file. The slide show is at "
Each week, I feature different slides. Currently, I update the external file with the new files and then update the html document with the beginning slide.

What I want to do is get rid of having to change the beginning slide in the HTML each week. Can I just add a variable to my external file and call for it in my HTML file? Could you help me with the proper script?

The external file is as follows:

myPix = new Array("
adURL = new Array("469882367","469882686")
thisPic = 0

imgCt = myPix.length - 1

function chgSlide(direction) {

if (document.images) {

thisPic = thisPic + direction

if (thisPic > imgCt) {

thisPic = 0

}

if (thisPic < 0) {

thisPic = imgCt

}
document.myPicture.src=
myPix[thisPic]

}

}

function newLocation() {

document.location.href = &quot; + adURL[thisPic]

}

The HTML file text is as follows:
<td Background=&quot; width='298' height='260'><A HREF=&quot;javascript:newLocation()&quot;><CENTER>
<!-- ENTER STARTING GALLERY PICTURE -->
<img src=&quot; NAME = &quot;myPicture&quot; width=&quot;170&quot; ALT=&quot;Click to View Auction&quot;></CENTER></td>
<td width='298'><font face='Times New Roman' color=#000000 size=4><B><CENTER>
<A HREF=&quot;javascript:chgSlide(-1)&quot;>&lt;&lt;&nbsp; Previous</A>&nbsp;&nbsp;
<A HREF=&quot;javascript:chgSlide(1)&quot;>Next &nbsp;&gt;&gt;</A> </CENTER></B></font></td>
Thanx
Cliff [sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top