?
Solved

Object Required on MoveNext()

Posted on 2011-05-11
1
Medium Priority
?
303 Views
Last Modified: 2012-05-11
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

0
Comment
Question by:doramail05
1 Comment
 
LVL 9

Accepted Solution

by:
Roman Gherman earned 2000 total points
ID: 35736011
you are missing a closing curly bracket

function MoveNext()
{
if (document.images && CurrentPic < ImageCount )
{
CurrentPic++
document.myPicture.src=PicArray[CurrentPic]
}
}

0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my daily work (mainly using ASP.net), I need to write a lot of JavaScript code. One of the most repetitive tasks I do are the jQuery Ajax calls. You know: (CODE) I don't know if for you it's the same, but for me is soooo tedious to write the …
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question