-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSlide_Show.js
37 lines (32 loc) · 1008 Bytes
/
Slide_Show.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
var duckList;
function initDuckList()
{
// set up the ducks doubly linked list
var duck = { url:"../img/duck.jpg", list:null };
var mallard = { url:"../img/Mallard2.jpg", list:null };
var uglyDuck = { url:"../img/uglyDuck.jpg", list:null };
var duckTales = { url:"../img/duckTales.jpg", list:null };
var daffyDuck = { url:"../img/daffyDuck.jpg", list:null };
duck.list = { next:mallard, prev:daffyDuck };
mallard.list = { next:uglyDuck, prev:duck };
uglyDuck.list = { next:duckTales, prev:mallard };
duckTales.list = { next:daffyDuck, prev:uglyDuck };
daffyDuck.list = { next:duck, prev:duckTales };
// duck starts at the head
return duck;
}
duckList = initDuckList();
function prev()
{
var image = document.getElementById("duckImages");
duckList = duckList.list.prev;
image.src = duckList.url;
return;
}
function next()
{
var image = document.getElementById("duckImages");
duckList = duckList.list.next;
image.src = duckList.url;
return;
}