From 30c3da8799917462608d9ed3a0a0ee72543dbf56 Mon Sep 17 00:00:00 2001 From: a74589669 <290198252@qq.com> Date: Sat, 24 Aug 2019 00:38:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=8C=E7=BA=A7=E8=8F=9C=E5=8D=95=E6=A0=8F?= =?UTF-8?q?=E5=AE=8C=E5=96=84=EF=BC=8C=E6=8E=A5=E4=B8=8B=E6=9D=A5=E5=81=9A?= =?UTF-8?q?=E5=90=8E=E7=AB=AF=E6=B8=B2=E6=9F=93seo=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App/Models/Doc.php | 10 ++++++++-- blog/basic.html | 12 ++---------- blog/css/left.css | 10 ++++++++-- blog/js/left.js | 30 ---------------------------- blog/js/scripts.js | 49 +++++++++++++++++++++++++++++++++++++++++----- public/index.php | 9 +-------- 6 files changed, 63 insertions(+), 57 deletions(-) diff --git a/App/Models/Doc.php b/App/Models/Doc.php index f02fc19..faba72f 100644 --- a/App/Models/Doc.php +++ b/App/Models/Doc.php @@ -34,10 +34,16 @@ class Doc extends Model return $result; } public function docs($id){ + $result = []; if(is_integer($id)){ $db = static::getDB(); - $stmt = $db->query('select title from doc where type = '.$id); - $result = $stmt->fetchAll(); + $stmt = $db->query('select id,title from doc where type = '.$id); + $recv = $stmt->fetchAll(); + foreach ($recv as $key => $value){ + $s['id']= $value['id']; + $s['title']= $value['title']; + array_push($result,$s); + } return $result; } } diff --git a/blog/basic.html b/blog/basic.html index b286871..30dc2f8 100644 --- a/blog/basic.html +++ b/blog/basic.html @@ -27,7 +27,7 @@ bottom: auto; left: 0px; right: 0px; - width: 800px; + width: 820px; height: 50px; z-index: 0; padding: 24px 0px 0px 0px; @@ -103,15 +103,7 @@
diff --git a/blog/css/left.css b/blog/css/left.css index 4664839..77889b2 100644 --- a/blog/css/left.css +++ b/blog/css/left.css @@ -5,6 +5,8 @@ width: 110px; height: 100%; padding-left: 4px; + padding-right: 10px; + background: #0b58a2; border: #0b93d5 solid 1px; border-radius: 1px; @@ -35,6 +37,7 @@ ul.navMenu{ text-decoration: none; color: #f5f8f9; border-top: 1px solid #222932; + text-align: center; } .navMenu>li.active>a, @@ -42,10 +45,11 @@ ul.navMenu{ .subMenu>li.active>a, .subMenu>li>a:hover { color: #f5f8f9; - background: #79c9ec; + cursor:default } .subMenu>li>a { + text-align: center; display: block; line-height: 36px; font-size: 10px; @@ -60,7 +64,9 @@ ul.subMenu { } .subMenu>li>a { - padding-left: 20px; + padding-left: 0px; + padding-right: 30px; + } a.arrow:after { diff --git a/blog/js/left.js b/blog/js/left.js index 2aaf003..e69de29 100644 --- a/blog/js/left.js +++ b/blog/js/left.js @@ -1,30 +0,0 @@ -$(function() { - //鍒濆鍖 - $('.subMenu').hide(); - $('li.active>.subMenu').show(); - //缁欒彍鍗曢」娣诲姞浜嬩欢 - $('.navMenu a').click(function() { - //鑾峰彇鎵灞炲垪琛╱l - var $subMenuElement = $(this).next(); - var $liElement = $(this).parent(); - var $ulElement = $(this).parent().parent(); - //娌℃湁瀛愯彍鍗曪紝鍒欑洿鎺ヨ繑鍥 - if (!$subMenuElement.is('ul')) { - $ulElement.find('li').removeClass('active'); - $ulElement.find('ul.subMenu').slideUp(); - $liElement.addClass('active'); - return; - } - //濡傛灉瀛樺湪瀛愯彍鍗曪紝鍒欐墦寮鎴栬呭叧闂 - if (!$liElement.hasClass('active')) { - $ulElement.find('li').removeClass('active'); - $ulElement.find('ul.subMenu').slideUp(); - $liElement.addClass('active'); - $subMenuElement.slideDown(); - } else { - //鎵撳紑鐘舵 鍒欏叧闂湰鑿滃崟 - $subMenuElement.slideUp(); - $liElement.removeClass('active'); - } - }); -}); diff --git a/blog/js/scripts.js b/blog/js/scripts.js index 138bb96..039ee1d 100644 --- a/blog/js/scripts.js +++ b/blog/js/scripts.js @@ -1,5 +1,38 @@ -console.log("shit2"); +function updateMenu(){ + //鍒濆鍖 + $('.subMenu').hide(); + $('li.active>.subMenu').show(); + //缁欒彍鍗曢」娣诲姞浜嬩欢 + $('.navMenu a').click(function() { + //鑾峰彇鎵灞炲垪琛╱l + var $subMenuElement = $(this).next(); + var $liElement = $(this).parent(); + var $ulElement = $(this).parent().parent(); + //娌℃湁瀛愯彍鍗曪紝鍒欑洿鎺ヨ繑鍥 + if (!$subMenuElement.is('ul')) { + $ulElement.find('li').removeClass('active'); + $ulElement.find('ul.subMenu').slideUp(); + $liElement.addClass('active'); + return; + } + //濡傛灉瀛樺湪瀛愯彍鍗曪紝鍒欐墦寮鎴栬呭叧闂 + if (!$liElement.hasClass('active')) { + $ulElement.find('li').removeClass('active'); + $ulElement.find('ul.subMenu').slideUp(); + $liElement.addClass('active'); + $subMenuElement.slideDown(); + } else { + //鎵撳紑鐘舵 鍒欏叧闂湰鑿滃崟 + $subMenuElement.slideUp(); + $liElement.removeClass('active'); + } + }); +} + +$(function() { + updateMenu(); +}); $(document).ready( function () { console.log("test"); @@ -18,7 +51,7 @@ $(document).ready( console.log(obj); Object.keys(obj).forEach(function (key) { //$("#navMenu").style.border = "3px solid green"; - $("#navMenu").append('