-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
47 lines (37 loc) · 1.47 KB
/
script.js
File metadata and controls
47 lines (37 loc) · 1.47 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
/*global $*/
$("document").ready(function () {
"use strict";
// $("a.animation[about]").addClass("active");
// $('.animation[href="#about"]').trigger("click");
//to add brackets to about as soon as page loads
$(function () {
$('.animation[href="#about"]').trigger("click");
});
//to make about button interactive
// $("mybutton").on('click', function () {
// console.log("button is responding");
// $("dynamicabout").removeClass("show");
// });
// document.getElementById("mybutton").onclick = function() {
// console.log("About button is responding.");
// document.getElementById("dynamicabout").className = "";
// console.log(document.getElementById("dynamicabout").className);
// }
//to make close button hide dynamicabout div
$("closebutton").click(function () {
$("dynamicabout").addClass("show");
});
//to make page scroll to appropriate section when navbar link is clicked
$(".animation").click(function (event) {
$(".active").removeClass("active");
$(this).addClass("active");
event.preventDefault();
var target = $(this).attr('href');
if (target.length) {
$('html, body').stop().animate({
scrollTop: $(target).offset().top
// scrollTop: $(target).offset().top - $("#navbar").innerHeight()
}, 1000);
}
});
});