XF 1.2 Menu bar fixed

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!
 
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
 
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.webp
 
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.webp

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.
 
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.

View attachment 61805

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.


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'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?

View attachment 61804

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.
 
Add this to the end of: page_container_js_head

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?

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.

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...
 
Thanks for your reply. Tried using TMS. Searched for
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...

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:
You have posted this:
Rich (BB 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:
Rich (BB code):
<script>
    if (window.location.hash && window.location.hash.indexOf('#post') !== -1 ) {
      window.scrollBy(0,-125);
    }
    });
</script>
<!--XenForo_Require:JS-->
 
Back
Top Bottom