-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
43 lines (40 loc) · 936 Bytes
/
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
$("#submit-form").submit((e) => {
e.preventDefault();
$.ajax({
url: "",
data: $("#submit-form").serialize(),
method: "post",
success: function (response) {
alert("Form submitted successfully");
window.location.reload();
},
error: function (err) {
alert("Something Error");
},
});
});
$(document).ready(function () {
$("#menu").click(function () {
$(this).toggleClass("fa-times");
$("header").toggleClass("toggle");
});
$(window).on("scroll load", function () {
$("#menu").removeClass("fa-times");
$("header").removeClass("toggle");
if ($(window).scrollTop() > 0) {
$(".top").show();
} else {
$(".top").hide();
}
});
$('a[href*="#"]').on("click", function (e) {
e.preventDefault();
$("html, body").animate(
{
scrollTop: $($(this).attr("href")).offset().top,
},
500,
"linear"
);
});
});