-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
50 lines (41 loc) · 1.42 KB
/
script.js
File metadata and controls
50 lines (41 loc) · 1.42 KB
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
$(document).ready(function(){
peopleArray = [];
$.getJSON("people.json", function(data){
for(var i = 0; i < data.length; i++){
peopleArray.push(data[i]);
}
console.log(peopleArray)
});
$("img").fadeIn(4000);
$("#credit").fadeIn(3000);
$("#moreInfo").fadeIn(3000);
$("#backgroundWriting1").fadeOut(10000);
$("#backgroundWriting2").fadeOut(10000);
$("img").on("click", function (){
var parent = $(this).attr("tabindex");
console.log($(this));
console.log(parent);
var person = peopleArray[parent];
console.log(person.name);
var nameNoSpace = person.name.split(' ').join('').toLowerCase();
var imgString = "img/zoom/" + nameNoSpace + ".jpg";
$("#name").text(person.name);
$("#years").text(person.years);
$("#bio").text(person.biography);
$("#zoomIMG").attr("src", imgString);
$("#bioTable").show();
$("#mask").show();
});
$("#mask").on("click", function(){
$("#mask").hide();
$("#bioTable").hide();
});
$("img").on("mouseover", function(){
//$(this).animate({"width": "226px", "height": "219px"}, 200);
$(this).animate({"bottom": "15px"}, 400);
});
$("img").on("mouseleave", function() {
//$(this).animate({"width": "206px", "height": "199px"}, 200);
$(this).animate({"bottom": "0px"}, 300);
});
});