Click to See Complete Forum and Search --> : Incrementing picture


FrozenDice
12-26-2004, 09:42 PM
I couldn't find the javascript forum for some reason. Heres what I have so far. And let me warn your, I have almost no experience in javascript, but I learn through experimentation, thats how I learned all my other languages.

<html>
<head>
<script language="Javascript">

pic1 = new Image()
pic1.src = "poll.jpg"
pic2 = new Image()
pic2.src = "star2.jpg"
pic3 = new Image()
pic3.src = "star.jpg"
pic4 = new Image()
pic4.src = ""
pic5 = new Image()
pic5.src = ""
pic6 = new Image()
pic6.src = ""
pic7 = new Image()
pic7.src = ""
var numbers = "0";
var past;
</script>

</head>

<body>
<img src="ryoga.jpg" name="mainpic">
<A HREF="#"
onclick=" var past = ("pic" + (numbers + 1)) ; mainpic.src= past ; ">NEXT</A>

</body>
</html>

I am trying to have it so when you click the link, it changes the source of the picture so the next one shows. I am trying to preload the images in the header. So I really have no clue. Please help. And please move this to the right forum if it still exists.

toicontien
12-27-2004, 10:26 AM
Try posting this question in the DHTML (http://www.webdeveloper.com/forum/forumdisplay.php?s=&forumid=8) forum.