-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
70 lines (53 loc) · 1.75 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
58
59
60
61
62
63
64
65
66
67
68
$(document).ready(function(){
/* Show dropdown menu */
function showMenu (e) {
e.stopPropagation();
$(".dropdown-menu").fadeToggle(200);
/*$(".dropdown-menu").toggleClass("hidden");*/
}
/* Show Info services */
function showInfo (e) {
e.stopPropagation();
e.preventDefault();
if ($(this).find(".services-info").length) {
$(this).find(".services-info").fadeToggle(400);
$(this).find(".applyTeaser").toggleClass("transparency");
$(this).find("h3").toggleClass("transparency");
}
else if ($(this).find(".approach-info").length) {
$(this).find(".approach-info").fadeToggle(400);
$(this).find(".applyTeaser").toggleClass("transparency");
$(this).find("h3").toggleClass("transparency");
}
}
/* Ajax - show after submitting info */
$("form").on("submit", submitForm);
function submitForm(event) {
event.stopPropagation();
event.preventDefault();
var form = $(this);
var data = form.serialize();
form.find("input[type='text']").val("");
form.find("input[type='email']").val("");
form.find("textarea").val("");
form.find(".showMessage").fadeToggle(500);
form.delay(3000).queue(function(){
form.find(".showMessage").fadeToggle(5000);
form.dequeue();
});
$.ajax(form.attr("action"), {
type: form.attr("method"),
data: data,
success: function(response) {
}
});
}
/* Show navigation menu - Header nav section */
$(".dropdown-button").on("click", showMenu);
$(".dropdown-menu").on("click", showMenu);
/* Show services info - Services section */
/* $(".teaser").on("mouseenter", showInfo);
$(".teaser").on("mouseleave",showInfo);*/
$(".teaser").on("click", showInfo);
$(".teaser-approach").on("click", showInfo);
});