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

github.com/varkai/hugo-theme-zozo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'static/js/zozo.js')
-rw-r--r--static/js/zozo.js39
1 files changed, 39 insertions, 0 deletions
diff --git a/static/js/zozo.js b/static/js/zozo.js
new file mode 100644
index 0000000..2781442
--- /dev/null
+++ b/static/js/zozo.js
@@ -0,0 +1,39 @@
+'use strict';
+
+// back-to-top
+$(document).ready((function (_this) {
+ return function () {
+ let bt
+ bt = $('#back_to_top')
+ if ($(document).width() > 480) {
+ $(window).scroll(function () {
+ let st
+ st = $(window).scrollTop()
+ if (st > 30) {
+ return bt.css('display', 'block')
+ } else {
+ return bt.css('display', 'none')
+ }
+ })
+ return bt.click(function () {
+ $('body,html').animate({
+ scrollTop: 0,
+ }, 800)
+ return false
+ })
+ }
+ }
+})(this))
+
+// fancybox
+$(document).ready((function (_this) {
+ return function() {
+ if ($.fancybox) {
+ $('.post_content').each(function() {
+ $(this).find('img').each(function() {
+ $(this).wrap(`<div class="fancybox"><a href="${this.src}" data-fancybox="gallery" data-caption="${this.title}"></a></div>`);
+ });
+ });
+ }
+ };
+})(this))