Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/vickylaixy/hugo-theme-introduction.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/static
diff options
context:
space:
mode:
authorHanzei <hanzei@mailbox.org>2018-07-01 11:09:29 +0300
committerHanzei <hanzei@mailbox.org>2018-07-01 11:09:29 +0300
commitdaca1fe109da3b57005cfe77c27819f9666c646d (patch)
tree98da048782aae45ddf79463e73969c3fbef67ec1 /static
parent11587f7efe568e46075321af7f4a1bec54a6ae04 (diff)
Use baseof temple to dry code
Diffstat (limited to 'static')
-rw-r--r--static/js/index.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/static/js/index.js b/static/js/index.js
new file mode 100644
index 0000000..847d6a4
--- /dev/null
+++ b/static/js/index.js
@@ -0,0 +1,22 @@
+// Bitty scrolling links script
+$('a[href^="#"]').click(function(e) {
+ e.preventDefault();
+ $('html, body').animate({
+ scrollTop: $(this.hash).offset().top
+ }, 500);
+ $("#nav-menu").removeClass("is-active");
+ return true;
+})
+
+// Modal closer
+$('.card').click(function () {
+ $('#'+this.id+'.modal').addClass('is-active');
+});
+$('.modal-close').click(function () {
+ $('#'+$(this).parent('.modal').get(0).id+'.modal').removeClass('is-active');
+});
+$(document).keypress(function(e) {
+ if(e.which == 0) {
+ $('.modal.is-active').removeClass('is-active');
+ }
+});