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

Floating Top Bar

Discussion in 'Styling and Customization Questions' started by Matthew2D, Jan 30, 2012.

  1. Matthew2D

    Matthew2D Active Member

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

    Thanks!
     
  2. Forsaken

    Forsaken 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/

    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>
    
     
    Matthew2D likes this.
  3. Matthew2D

    Matthew2D Active Member

    Works perfectly, just that the bar goes over the logo.
     
  4. Forsaken

    Forsaken Well-Known Member

    You'll probably have to adjust it as it was for a really modified style.
     

Share This Page