From 31f224fd82cbba8a3e4bcfb10f2625eb9646f8ce Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 7 May 2015 11:43:11 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=94=E5=9B=9E=E9=A1=B6=E9=83=A8=E5=8A=A8?= =?UTF-8?q?=E6=80=81=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/bids/_homework.html.erb | 11 +++++++++++ app/views/homework_attach/_homeworks_list.html.erb | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/app/views/bids/_homework.html.erb b/app/views/bids/_homework.html.erb index 0cb1ff7cc..0272f2c63 100644 --- a/app/views/bids/_homework.html.erb +++ b/app/views/bids/_homework.html.erb @@ -59,6 +59,17 @@ } ); } + + $(window).scroll(function(){ + //获取窗口的滚动条的垂直位置 + var s = $(window).scrollTop(); + //当窗口的滚动条的垂直位置大于页面的最小高度时,让返回顶部元素渐现,否则渐隐 + if( s > 600){ + $("#gotoTop").fadeIn(100); + }else{ + $("#gotoTop").fadeOut(200); + }; + });