Dear all,
First of all, apologize me for asking you this very dumb question. i am totally newcomer to javascripts and have no prior knowledge on it at all. but i am keen to learn.

This is my problem :
i have created my external javascripts named image.js and save it in the same folder with images and other HTML files.

I included the external JS in my index.html : <head> with <script type="text/javascript" src="image.js"></head>

what this script supposed to do is to rotate images automatically as it appear in the page.
Here is my problem:
i do not how or what to do so that the script does the work.

this is the image.js :

//preload images
var image1=new Image()
image1.src='img1.JPG'
var image2= Image()
image2.src='img2.JPG'
var image3=new Image()
image3.src='img3.JPG'
//-->
var step=1
var whichimage=1
function slideit(){
if (!document.images)
return
document.images.slide.src=eval("image"+step+".src")
whichimage=step
if (step<3)
step++
else
step=1
setTimeout("slideit()",1800)
}
slideit()
function slidelink(){
if (whichimage==1)
window.location="link1.htm"

else if (whichimage==2)
window.location="link2.htm"
else if (whichimage==3)
window.location="link3.htm"

and this is where i wanted to have the pictures rotated in my index.html

<div id="text" >
		 THIS IS WHERE I WANTED TO DISPLAY THE IMAGES AND ROTATED HERE

                <h1><strong>Welcome to My Website</strong></h1>
				
                <p><strong>Student details</strong></p>
                <hr />

Could anyone Please and kindly help me what is the right solution to achieve this?

Thanks a million for your solutions.

Audre.

You have to call a function in the script from the body of the page for it to execute. Otherwise, it just sits there.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.