• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Floating Top Bar


Well-known member
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/

<script type="text/javascript">
$(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%'});
function(){ if ($(window).scrollTop() > 0) $(this).stop().animate({'opacity':'1'},400);},
function(){ if ($(window).scrollTop() > 0) $(this).stop().animate({'opacity':'0.7'},400);}