Link to home
Start Free TrialLog in
Avatar of doramail05
doramail05Flag for Malaysia

asked on

Object Required on MoveNext()

the js will display 3 picture with slideshow with moveprevious and movenexr
encountered 'Object Required' error on MoveNext();


<HTML>
<HEAD>
<TITLE>Slideshow Sample</TITLE>
<SCRIPT LANGUAGE="JAVASCRIPT" >
PicArray = new Array("images/01.jpg","images/02.jpg","images/03.jpg")
CurrentPic = 0
ImageCount = PicArray.length - 1
function MovePrevious()
{
if (document.images && CurrentPic > 0)
{
CurrentPic--
document.myPicture.src=PicArray[CurrentPic]
}
}
function MoveNext()
{
if (document.images && CurrentPic < ImageCount )
{
CurrentPic++
document.myPicture.src=PicArray[CurrentPic]
}

</SCRIPT>
</HEAD>
<BODY BGCOLOR="WHITE">
<CENTER>
<H1>My Slide Show</H1>
<IMG SRC="images/01.jpg" NAME="myPicture" ALT="My First Slideshow">
<BR>
<A HREF="javascript:MovePrevious();">&lt;&lt; Move Previous</A>
<A HREF="javascript:MoveNext();">Move Next &gt;&gt;</A>
</CENTER>
</BODY>
</HTML>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Roman Gherman
Roman Gherman
Flag of Moldova, Republic of image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial