Thursday, 3 November 2011

Badly need helps from experts

Badly need helps from experts

hey all,
im interested in learning to make slide show using javascript..i read some article and got some ideas somehow when i tried to create by my own it give me problem...i got some example from Internet and tried it...this is the code that i got and i edited it to what i want:
For example here:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<script language="javascript">
var image1=new Image();
var image2=new Image();
var image3=new Image();
image1.src="index.jpg";
image2.src="index1.jpg";
image3.src="index2.jpg";
</script>
</head>
<body>
<img src="./index.jpg" name="slide">
<script>
//variable that will increment through the images
var incre=1;
function slidepics(){
document.images.slide.src=eval("image"+incre+".src ");
if (step<3)
{step++;}
else
{step=1;}
//after 1s the pics will be changed
setTimeout("slidepics()",1000);
}
slidepics();
</script>
</body>
</html>

So any ideas...please help cause i tried it since yesterday and dont get why it didnt do as i wished...huhu...thanks in advanced

No comments:

Post a Comment