diff --git a/static/script.js b/static/script.js index 786f56f43a5c254a649b0c5b74abbb7796e01604..a60830bd421ea326487a3dba8f8caa95239ce4d1 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 8376a05cee1190462fc3f9a38e08060ced24c519..ec3dd0070453c97b088059f658eb27dac3831ba3 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 {