From 7be50ad743b9172f3f74b3eb4c7cfe0797f136f4 Mon Sep 17 00:00:00 2001 From: shenyu <448766534@qq.com> Date: Wed, 4 Dec 2019 19:27:58 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20pc=E4=BE=A7=E8=BE=B9=E6=A0=8F=E6=98=BE?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/css/_extend.styl | 2 +- source/js/ayer.js | 23 ++++++++++++++--------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/source/css/_extend.styl b/source/css/_extend.styl index 8fa8c23..467ad92 100644 --- a/source/css/_extend.styl +++ b/source/css/_extend.styl @@ -59,7 +59,7 @@ $base-style padding 1rem 1.5rem tbody tr:nth-child(2n) - background-color rgba(froth, .25) + background-color transparent blockquote display block diff --git a/source/js/ayer.js b/source/js/ayer.js index 603cc6a..f15c44d 100644 --- a/source/js/ayer.js +++ b/source/js/ayer.js @@ -127,26 +127,26 @@ // // lazyload $("img.lazy").lazyload({ - effect : "fadeIn" + effect: "fadeIn" }); // // justifiedGallery $('#gallery').justifiedGallery({ - rowHeight : 200, - margins : 5 + rowHeight: 200, + margins: 5 }); // $(document).ready(function ($) { $('.anchor').click(function (event) { event.preventDefault(); - $('main').animate({scrollTop: $(this.hash).offset().top}, 'smooth'); + $('main').animate({ scrollTop: $(this.hash).offset().top }, 'smooth'); }); }); // To top - (function($) { + (function ($) { // When to show the scroll link // higher number = scroll link appears further down the page var upperLimit = 1000; @@ -161,16 +161,16 @@ scrollElem.hide(); $('.content').scroll(function () { var scrollTop = $('.content').scrollTop(); - if ( scrollTop > upperLimit ) { + if (scrollTop > upperLimit) { $(scrollElem).stop().fadeTo(300, 1); // fade back in - }else{ + } else { $(scrollElem).stop().fadeTo(300, 0); // fade out } }); // Scroll to top animation on click - $(scrollElem).click(function(){ - $('.content').animate({scrollTop:0}, scrollSpeed); return false; + $(scrollElem).click(function () { + $('.content').animate({ scrollTop: 0 }, scrollSpeed); return false; }); })(jQuery); @@ -204,6 +204,11 @@ $sidebar.removeClass('on'); }); + if (window.matchMedia("(min-width: 768px)").matches) { + $content.addClass('on'); + $sidebar.addClass('on'); + } + })(jQuery);