From 2d8b8e8b8079d9cfd9e3196d24c85a991713c935 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BA=95=E5=B1=82=E7=94=A8=E6=88=B7?= Date: Sun, 14 Nov 2021 16:58:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=83=8C=E6=99=AF=E5=9B=BE?= =?UTF-8?q?=E7=89=87=E3=80=81CSS=20=E7=A7=BB=E5=8A=A8=E7=AB=AF=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- css/mobile.css | 28 +++++++++++++++++++++------- js/main.js | 7 +++++++ 2 files changed, 28 insertions(+), 7 deletions(-) diff --git a/css/mobile.css b/css/mobile.css index 8e66c6d..f6d92fc 100644 --- a/css/mobile.css +++ b/css/mobile.css @@ -93,8 +93,8 @@ } } -/*小于660px时*/ -@media (max-width: 660px) { +/*小于720px时*/ +@media (max-width: 720px) { /*左侧栏高度*/ .main-left { @@ -152,11 +152,23 @@ } -@media (min-width: 660px) { +/*小于390px时*/ +@media (max-width: 390px) { + .main-img img { + display: none; + } +} + + +/* 大于720px时 */ +@media (min-width: 720px) { .menu { display: none !important; } +} +/* 大于992px时 */ +@media (min-width: 992px) { /*时钟显示*/ span#win_text, span#win_speed { @@ -164,10 +176,12 @@ } } -/*小于390px时*/ -@media (max-width: 390px) { - .main-img img { - display: none; +/* 大于1400px时 */ +@media (min-width: 1400px) { + /*时钟显示*/ + span#win_text, + span#win_speed { + display: inline !important; } } diff --git a/js/main.js b/js/main.js index d08d3cd..e8857a9 100644 --- a/js/main.js +++ b/js/main.js @@ -121,6 +121,7 @@ function time() { } //必应壁纸 +/* var url = 'https://bird.ioliu.cn/v1/?url=https://www.bing.com/HPImageArchive.aspx?format=js&idx=0&n=8'; var imgUrls = JSON.parse(sessionStorage.getItem("imgUrls")); var index = sessionStorage.getItem("index"); @@ -152,6 +153,12 @@ if (imgUrls == null) { $section.css("background-size", "cover"); sessionStorage.setItem("index", index); } +*/ +//临时更换图片 api +var $section = $('#section'); +var url = "https://api.btstu.cn/sjbz/api.php?lx=fengjing&format=images"; +$section.css("background", "url('" + url + "') center center no-repeat #666"); +$section.css("background-size", "cover"); //加载动画 window.addEventListener('load', function () {