From 8e6694c021370d2ba70713a1360c7e910568e94f Mon Sep 17 00:00:00 2001 From: Argo-Lenovo Date: Mon, 21 Nov 2016 18:17:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9BUG=EF=BC=9A=E6=9C=89?= =?UTF-8?q?=E5=AD=90=E8=8F=9C=E5=8D=95=E7=9A=84=E8=8A=82=E7=82=B9=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E6=97=B6=EF=BC=8C=E8=87=AA=E5=8A=A8=E5=B1=95=E5=BC=80?= =?UTF-8?q?=E5=88=B0=E4=B8=8D=E5=8F=AF=E8=A7=81=E5=8C=BA=E5=9F=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Bootstrap.Admin/Content/js/common-scripts.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Bootstrap.Admin/Content/js/common-scripts.js b/Bootstrap.Admin/Content/js/common-scripts.js index d3213f45..cff1c0d1 100644 --- a/Bootstrap.Admin/Content/js/common-scripts.js +++ b/Bootstrap.Admin/Content/js/common-scripts.js @@ -23,9 +23,18 @@ var top = arch.offset().top; if (top > 0) { var middle = $('header').outerHeight() + $sidebar.outerHeight() / 2; - if (top > middle) $sidebar.animate({ scrollTop: top + arch.outerHeight() / 2 - middle }, 800); + if (top > middle) $sidebar.animate({ scrollTop: top + arch.outerHeight() / 2 - middle }, 500); } + $sidebar.on('click', 'a.dcjq-parent', function () { + var o = ($(this).offset()); + diff = 110 - o.top; + if (diff > 0) + $sidebar.scrollTo("-=" + Math.abs(diff), 500); + else + $sidebar.scrollTo("+=" + Math.abs(diff), 500); + }); + $('.sidebar-toggle-box').on('click', function () { if ($sidebar.is(":visible") === true) { $sidebar.hide();