-
Notifications
You must be signed in to change notification settings - Fork 0
/
myapp.js
52 lines (49 loc) · 1.45 KB
/
myapp.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
var shown=false;
var hm=false;
var work,bf,cnt=false;
$(document).ready(function(){
$(".btn").on("click", function(){
if (shown){$("#sideNav").addClass("hide");
shown=false;
}
else {
$("#sideNav").removeClass("hide");
shown=true;
}
});
// if the portfolio is selected
$("#portfolio").on("click",function(){
if (!work){$("#about").addClass("hide");
$("#contacto").addClass("hide");
$("#folio").removeClass("hide");
var work=true;
var bf,hm,cnt=false;
}
});
// if contact is selected then hide portfolio and contact info
$("#contact").on("click",function(){
if (!cnt){$("#about").addClass("hide");
$("#folio").addClass("hide");
$("#contacto").removeClass("hide");
var cnt=true;
var bf,hm,work=false;
}
});
// if the about is selected then hide everything else
$("#casa").on("click",function(){
console.log(hm);
if (!hm){$("#about").removeClass("hide");
$("#folio").addClass("hide");
$("#contacto").addClass("hide");
var work=true;
var bf,hm,cnt=false;
}
});
// when the my picture is selected it will enlarge while the mouse is held down and return to its size when the mouse is released
$("#foto").mousedown(function(){
$("#mifoto").animate({ width: "180px" });
});
$("#foto").mouseup(function(){
$("#mifoto").animate({ width: "40px" });
});
}); // this is the closing of the main function