Floating Top Bar

Matthew2D

Well-known member
Hello. How would I get the top bar to float? The one that says; moderation queue, reported items, admin panel.

Thanks!
 
This is based off of Cezz's work, but was modified for a client a while back so follow his directions, but replace his javascript code with what I provided: http://xenforo.com/community/threads/floating-navigation-bar.19295/

Code:
<script type="text/javascript">
$(function() {
$(window).scroll(function(){
($(window).scrollTop() > 1) ?
$('#moderatorBar').stop().animate({'opacity':'0.7'},400).css({'position':'fixed','top':'0px','z-index':'60', 'width': '100%'}):
$('#moderatorBar').stop().animate({'opacity':'1'},400).css({'position':'absolute','top':'0px', 'width': '100%'});
});
$('#moderatorBar').hover(
function(){ if ($(window).scrollTop() > 0) $(this).stop().animate({'opacity':'1'},400);},
function(){ if ($(window).scrollTop() > 0) $(this).stop().animate({'opacity':'0.7'},400);}
);
});
</script>
 
Top Bottom