-
Notifications
You must be signed in to change notification settings - Fork 1
/
script.js
57 lines (53 loc) · 1.11 KB
/
script.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
$(function()
{
$("#menu-photo-list a").click(function()
{
var imageSource = $(this).attr("href");
var desc = $(this).children("img").attr("alt");
showImage(imageSource,desc);
return false;
});
});
function showImage(src,desc)
{
$("#photo-big").addClass("loading");
$("#photo-big img").fadeOut("slow")
.remove();
$("#photo-big p").fadeOut("slow")
.remove();
var largeImage = new Image();
$(largeImage).attr("src", src)
.attr("alt", desc)
.load(function()
{
$(largeImage).hide();
$("#photo-big").removeClass("loading")
.append(largeImage);
$(largeImage).fadeIn("slow");
$(largeImage).after("<p class='photo-text'>"+desc+"</p>");
}
);
}
function slideshow(startidx)
{
var photo = photos[startidx];
$("#slideshow img").remove();
var largeImage = new Image();
$(largeImage).attr("src", photo)
.load(function()
{
$(largeImage).hide();
$("#slideshow").append(largeImage);
$(largeImage).fadeIn("slow");
}
);
if (startidx == photos.length - 1)
{
startidx = 0;
}
else
{
startidx = startidx + 1;
}
setTimeout("slideshow("+startidx+")", speed);
}