From ed4f09b6c12b18a1d2647fb25281a48d2d61f28f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BD=97=E5=AE=AA?= Date: Wed, 10 Jun 2015 11:51:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BE=A7=E8=BE=B9=E5=AF=BC=E8=88=AA=E6=9B=B4?= =?UTF-8?q?=E6=94=B9=E4=B8=8B=E6=8B=89=E6=95=88=E6=9E=9C=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- static/script.js | 24 +++++++++++++++++++++--- static/style.css | 3 +++ 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/static/script.js b/static/script.js index 786f56f43a..a60830bd42 100644 --- a/static/script.js +++ b/static/script.js @@ -33,7 +33,19 @@ $(function() { $(this).parent().parent().addClass('expand'); } }); - + $.easing['jswing'] = $.easing['swing']; + $.extend($.easing,{ + easeInCirc: function (x, t, b, c, d) { + return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b; + }, + easeOutCirc: function (x, t, b, c, d) { + return c * Math.sqrt(1 - (t=t/d-1)*t) + b; + }, + easeInOutCirc: function (x, t, b, c, d) { + if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b; + return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b; + } + }); var navFunc = { navStrArr: [], init: function() { @@ -124,19 +136,25 @@ $(function() { var self = this; var title = self.listBox.find("h4"); title.bind("click", function(e) { - var parent = $(this).parent(); + var parent = $(this).parent(), + list=parent.find("ul"); if (parent.attr("open")) { parent.removeAttr("open"); if (parent.index() == self.num) { $(this).addClass("current"); } + list.animate({marginTop:-list.height()},400,"easeInOutCirc",function (){ + list.css({"display":"none"}) + }) } else { parent.attr("open", true); if (parent.index() == self.num) { $(this).removeClass("current"); } + list.css({"display":"block","margin-top":-list.height()}); + list.animate({marginTop:0},400,"easeInOutCirc") } - parent.find("ul").slideToggle(300); + //parent.find("ul").slideToggle(300); }); } }; diff --git a/static/style.css b/static/style.css index 8376a05cee..ec3dd00704 100644 --- a/static/style.css +++ b/static/style.css @@ -456,6 +456,9 @@ footer ul li > a { cursor: pointer; transition: background .5s, border .5s; border-left: 3px solid transparent; + position: relative; + z-index: 1; + background: #F9F9F9; } .aside-container li>ul { -- GitLab