![]() |
Sticky Top Bar
1 Attachment(s)
I have used the idea and some code from XiTCLUB
This can work in a more simple way and act in the general navbar too. Template Navbar ************* as line number 2 paste <div id="stickyBar"> additional.css *********** Code:
#stickyBar.stick { Set the height of the Navbar incl submenu (my page Navbar is height:59px;) It is important to add the correct px Template Headinclude ****************** Code:
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script> If you use another jquery version is also okay. It is important to add the correct px If you use Google Translate disappear the top of the navbar!! You can see it in action here, but only with this style http://www.corvetteworld.dk/forums/forum.php?styleid=7 |
Is this the same as this:
https://vborg.vbsupport.ru/showthread.php?t=297532 |
No - here is used standard navbar and not a new!
|
It works, awesome.
http://www.gamerperfection.com/forum.php |
Problem - it does not scroll sideways?
i.e. if the browser window is smaller it does not scroll with the page if you move the horizonal bar? |
If you put 171px or so instead of 190px (Headinclude) and your background image in additional.css as the background instead of the dark color it will work better.
Your page will be no less if the browser window is smaller nor!!! |
I'm not sure you understood what I was saying.
If I reduce the width of my browser window so it's less than 1260px (which is the width of the site), then the horizontal scroll bar appears. When I move the horizontal scroll bar the whole site moves with the exception of the sticky navbar. This is also an issue on smart phones if you view the site and zoom in, then when you move the page horizontally everything moves except the sticky navbar. So if the window is smaller in width than the navbar when it becomes a sticky navbar you can't see the end of it and therefore can't see the buttons. |
In additional.css
width:100%; max-width:1260px; |
No, that's no good. What that does is it will wrap the navbar so if the window width is reduced anything on the right side will drop underneath, which is fine, but the menu items that drop underneath can't be clicked.
Try it out on my site yourself: http://www.gamerperfection.com Try it full window, then reduce the window so that the horizontal bar appears and you can see what I mean. I assume the bar doesn't move with the horizontal scroll because the bar is in a fixed position. |
Quote:
|
Well instead of having it fixed is it not possible to have it so it moves sideways with the site if necessary?
|
Very awesome template mod. Thanks for sharing. :)
|
Quote:
|
What is the point in this mod then if the right end of the sticky bar is inaccessible and if it wraps to the second line then it overlays the information underneath the navigation therefore making that bit unuseable.
|
Author forget to close div, before:
HTML Code:
</div><!-- closing div for above_body --> HTML Code:
</div><!-- closing div for above_body --> HTML Code:
</div> HTML Code:
</div> |
Not sure what you mean here..
Code:
</div> I downloaded, added the code to the necessary areas, did some tweaking and all seems well. I tried to do this myself a while back, didn't succeed. So now it does the job, well done bjarne2 sir. Thanks for your effort.. |
I did however find a minor issue.
When a user clicks the arrow icon in a quoted message, the page opens but the top of the message is clipped. i.e. obscured by the navbar. Otherwise this would work perfectly. |
Look to color of footer... is same as color of navbar without closed div. In some chances is not a problem.
|
I am seeing nothing different.
Perhaps in your style there may well be something different? |
Then I install this mod, i was have default style of vB4.2.2
And without closed div, I was haved color of foot same as stiky navbar(dark-blue). When I add </div>, color of foot staying with default color. |
I see. I had the same issue with the subnav being dark blue.
I just changed the background colour in additional.css. Code:
#stickyBar.stick { |
DemOnstar, may be I`m wrong... But my point in this:
Then you add to your postbit template: Code:
as line number 2 paste Normally div look like this: Code:
<div id="someID">content of this div</div> |
I do not think you are wrong squire, in fact you are correct.
Code:
<div>Now I believe the subject is closed.</div> That is of course except for https://vborg.vbsupport.ru/showpost....8&postcount=18 which is my main issue. Thank you. |
works great, thank you :)
|
I posted the other day about this modification. I've deleted that post and will attempt to clarify a bit better in this one.
This mod certainly works. But it seems to have some inconsistencies from forum site to forum site. On my forum site the sticky navbar won't correctly re-size with window dimension changes on any of the browsers that I've tested. That is, when the sticky anchor point is set correctly for a maximized window, although it continues to work fine while the window remains maximized, both the sticky anchor point and the width setting for the navbar fail to maintain proper positioning when the browser window is reduced to a smaller size. However, my observations suggests that this problem may be peculiar to my forum site alone... as I've noticed that those position/dimensional properties seem to track reasonably well on certain other vB sites where this mod has been added. There does seem to be a problem with it on the site that bjarne2 posted a link for, though. That is, on Google Chrome the entire navbar scrolls up and stops at its correct anchor point (as it should) and its tabs align properly at the top of the browser window and are accessible (as they should be). But when I view the same page with Firefox, the tabs scroll off screen as if the anchor point has been set much higher. Only the navbar links below remain visible. And another important concern seems to exist on every forum site using this mod that I've checked. That is, when the navbar correctly sticks where it should, it tends to cover up the top portion of posts that have been called by their respective anchor point URL's. This is the same issue that DemOnstar has pointed out. Simply stated, you can't see the text near the tops of those anchor-positioned posts because the sticky navbar is in the way. A solution may be that some padding can be added to showthread (or somehow) to push the content of those posts down a bit. Aside from the issues I've mentioned, this would be a great mod that I would otherwise consider using. |
installed...I added the option for members to choose whether to stick/unstick
Code:
<!-- sticky navbar --> |
All times are GMT. The time now is 05:49 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|