mendesdusters
Programmer
I want to have plus and minus buttons that control image swapping. It seems like an easy enough concept of incrementing an array but I cannot get it to work. Any help is appreciated. The code is short and is given below.
_________________________________________________________________
<html>
<head>
<script LANGUAGE="JavaScript">
var help_array = new Array()
help_array[0] = "one.jpg"
help_array[1] = "two.jpg"
help_array[2] = "three.jpg"
var inc = 0;
function plus(intitial) {
document.prelim_setup_help.src = intitial
inc++
current = help_array[inc]
}
function plus(intitial) {
document.prelim_setup_help.src = intitial
current = help_array[inc]
inc--
current = help_array[inc]
}
</script>
</head>
<body>
<a href="javascriptlus(current);">plus</a>
<a href="javascript:minus(current);">minus</a>
<img src="one.jpg" name="prelim_setup_help"></img>
</body>
</html>
_________________________________________________________________
<html>
<head>
<script LANGUAGE="JavaScript">
var help_array = new Array()
help_array[0] = "one.jpg"
help_array[1] = "two.jpg"
help_array[2] = "three.jpg"
var inc = 0;
function plus(intitial) {
document.prelim_setup_help.src = intitial
inc++
current = help_array[inc]
}
function plus(intitial) {
document.prelim_setup_help.src = intitial
current = help_array[inc]
inc--
current = help_array[inc]
}
</script>
</head>
<body>
<a href="javascriptlus(current);">plus</a>
<a href="javascript:minus(current);">minus</a>
<img src="one.jpg" name="prelim_setup_help"></img>
</body>
</html>