ampulator00
07-06-2004, 03:03 AM
Is it possible to combine these two functions?
var thisPic = 0;
function chgSlide(direction)
{
imgCt = slideChoice[0].length -1;
if(document.images)
{
thisPic += direction;
if(thisPic > imgCt)
{
thisPic = 0;
}
if(thisPic < 0)
{
thisPic = imgCt;
}
document.getElementById(slideID[0]).src = slideChoice[0][thisPic]
}
}
function chgSlide1(direction)
{
imgCt = slideChoice[1].length -1;
if(document.images)
{
thisPic += direction;
if(thisPic > imgCt)
{
thisPic = 0;
}
if(thisPic < 0)
{
thisPic = imgCt;
}
document.getElementById(slideID[1]).src = slideChoice[1][thisPic]
}
}
var thisPic = 0;
function chgSlide(direction)
{
imgCt = slideChoice[0].length -1;
if(document.images)
{
thisPic += direction;
if(thisPic > imgCt)
{
thisPic = 0;
}
if(thisPic < 0)
{
thisPic = imgCt;
}
document.getElementById(slideID[0]).src = slideChoice[0][thisPic]
}
}
function chgSlide1(direction)
{
imgCt = slideChoice[1].length -1;
if(document.images)
{
thisPic += direction;
if(thisPic > imgCt)
{
thisPic = 0;
}
if(thisPic < 0)
{
thisPic = imgCt;
}
document.getElementById(slideID[1]).src = slideChoice[1][thisPic]
}
}