From c74da4b41e6413d126ae8d6aa62874627cb14fca Mon Sep 17 00:00:00 2001 From: gebele Date: Tue, 9 Apr 2013 16:50:56 +0200 Subject: adjusted for services update --- views/layout.haml | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'views/layout.haml') diff --git a/views/layout.haml b/views/layout.haml index 7c05190..b6606a1 100644 --- a/views/layout.haml +++ b/views/layout.haml @@ -20,7 +20,32 @@ %h1 Lazar Toxicity Predictions %hr - .content + .content + :javascript + $(document).ready(function(){ + // hide #back-top first + $("#back-top").hide(); + // fade in #back-top + $(function () { + $(window).scroll(function () { + if ($(this).scrollTop() > 400) { + $('#back-top').fadeIn(); + } else { + $('#back-top').fadeOut(); + } + }); + // scroll body to 0px on click + $('#back-top a').click(function () { + $('body,html').animate({ + scrollTop: 0 + }, 500); + return false; + }); + }); + }); + #back-top + %a{:href => ""}^ top ^ + = yield .footer -- cgit v1.2.3