From ad3bb7b13a75b7a2e23a6be637737ecd11567ed0 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Sat, 15 Mar 2014 14:52:13 -0300 Subject: Squashed 'mod/magic_topbar/' content from commit 0fdca8a git-subtree-dir: mod/magic_topbar git-subtree-split: 0fdca8adb73fe9e2b5be69c00c15760c8fba3366 --- views/default/magic_topbar/js.php | 40 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 views/default/magic_topbar/js.php (limited to 'views/default/magic_topbar/js.php') diff --git a/views/default/magic_topbar/js.php b/views/default/magic_topbar/js.php new file mode 100644 index 000000000..cb51913f3 --- /dev/null +++ b/views/default/magic_topbar/js.php @@ -0,0 +1,40 @@ + + +$(function() { + + var $topbar = $(".elgg-page-topbar"), + $window = $(window); + + $topbar.css({position: 'fixed', width: '100%'}); + + $window.scroll(function() { + $topbar.stop(); + var opacity; + if ($window.scrollTop() > 14) { + $topbar.animate({opacity: 0}, 'fast'); + } else { + $topbar.css({opacity: 1}); + } + }); + + $topbar.mouseenter(function(){ + $topbar.stop(); + $topbar.animate({opacity: 1}); + }) + .mouseleave(function(){ + $topbar.stop(); + var opacity; + if ($window.scrollTop() > 14) { + opacity = 0; + } else { + opacity = 1; + } + $topbar.animate({opacity: opacity}); + }); +}); -- cgit v1.2.3