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

XF 1.2 Menu bar fixed

Discussion in 'Styling and Customization Questions' started by AndreaMarucci, Nov 11, 2013.

  1. AndreaMarucci

    AndreaMarucci Well-Known Member

    Hello, does someone think it's possible to achieve this effect

    http://www.google.it/intx/it/enterprise/apps/business/products.html

    for the Xenforo menubar? If you scroll down the menu bar is always at the top. I think should be very interesting to have the menubar always handy in this way.

    I think that Audentio has implemented such a thing in their templates so I'm asking here if this could be accomplished in some way.

    I've seen here a thread about a possible solution but it's not as elegant e fast as the Google or Audentio one.

    Thanks!
     
  2. AndreaMarucci

    AndreaMarucci Well-Known Member

  3. Mouth

    Mouth Well-Known Member

    Several themes already do this, including UI.X
     
  4. AndreaMarucci

    AndreaMarucci Well-Known Member

    I'd need a method to replicate this on my forum...
     
  5. AndreaMarucci

    AndreaMarucci Well-Known Member

    Here the solution almost perfect. Thanks to @Shelley and @netkingZ

    The only problem I've now is that when I click on the New Posts link the page scroll but, since the top is fixed, the first unread message is partially hidden under the top and I'm searching a way to avoid this...

    Insert in Extra.css
    Code:
    #header
    {
        @property "header";
        background-color: @primaryMedium;
        @property "/header";
        position:fixed !important;
        z-index:7000;
        -moz-box-shadow: 2px 2px 2px rgba(0,0,0,0.5);
        -webkit-box-shadow: 2px 2px 2px rgba(0,0,0,0.5);
        box-shadow: 2px 2px 2px rgba(0,0,0,0.5);
    
    }
    
    #moderatorBar
    {
    background-color: @primaryDarker;
    border-bottom: 1px solid @primaryLightish;
    font-size: 11px;
    position:fixed;
    z-index:10000;
    margin: 0px auto 0px auto;
    width:100%
    }
    
    #content {
    margin-top:20px;
    }
    
    and you've to modify the template logo_block and insert at the very beginning
    Code:
    <div style="height:20px;"></div>
    If you want to try it you can browse http://forum.kog.it
     
    Adam Howard likes this.
  6. AndreaMarucci

    AndreaMarucci Well-Known Member

    i'd need some help.

    If I see the forum from mobile (tablet or smartphone), the moderator bar is placed like in this attachment and not on the top where it should be. Can someone tell me how to fix this?

    modbar.png
     
  7. AndreaMarucci

    AndreaMarucci Well-Known Member

    The other problem, as I've said before, is that when I click on a thread to see the new posts, the forum position myself on the first unread post but half of this post is hidden under the fixed header.

    scroll.jpg

    I ask if there's a mean to tell Xenforo to scroll up a little bit so that the post is shown from the start. Any help will be much much appreciated.
     
  8. EQnoble

    EQnoble Well-Known Member


    Add this to the end of: page_container_js_head
    Code:
    <script>
        if ( document.location.href.indexOf('#post') > -1 ) {
          window.scrollBy(0,-125);
        }
        });
    </script>

    I would need to see the moderator bar in a page myself to be able to tell why it is doing that, without seeing what you have done to it I would guess it has to do with position.
     
  9. AndreaMarucci

    AndreaMarucci Well-Known Member

    Thanks for your reply. Tried using TMS. Searched for
    Code:
    <!--XenForo_Require:JS-->
    and replaced with
    Code:
    <script>
        if ( document.location.href.indexOf('#post') > -1 ) {
          window.scrollBy(0,-125);
        }
        });
    </script>
    <!--XenForo_Require:JS-->
    but the behaviour is the same. The first unread post is truncated. There's anything I've to do other than this?

    If it's alright for you I've no problems to send you a PC with login credentials. Tell me if you need or not admin credentials eventually...
     
  10. Jeremy

    Jeremy XenForo Moderator Staff Member

  11. EQnoble

    EQnoble Well-Known Member

    go ahead and create me a login that gives me access to templates and I will check it out for you...I know that it should work because I use it myself.
     
    Last edited: Nov 25, 2013
    Shelley likes this.
  12. AndreaMarucci

    AndreaMarucci Well-Known Member

    Thanks, I'll send you a PC asap...
    Thanks Jeremy but I really don't know what you're talking about. I'm not a developer :(
     
  13. Jeremy

    Jeremy XenForo Moderator Staff Member

    You have posted this:
    Code:
    <script>
        if ( document.location.href.indexOf('#post') > -1 ) {
          window.scrollBy(0,-125);
        }
        });
    </script>
    <!--XenForo_Require:JS-->
    It does appear to include the hash in at least chrome, but the safer bet would be do use window.location.hash:
    Code:
    <script>
        if (window.location.hash && window.location.hash.indexOf('#post') !== -1 ) {
          window.scrollBy(0,-125);
        }
        });
    </script>
    <!--XenForo_Require:JS-->
     
  14. AndreaMarucci

    AndreaMarucci Well-Known Member

    Thanks. I'll wait for @EQnoble so that our works doesn't overlap...
     

Share This Page