Login Register






Sticky navbar filter_list
Author
Message
Sticky navbar #1
I've been thinking about some CSS tweaks to the site's theme recently, and a big one I think any people would like is a sticky navbar, i.e. one that stays at the top of the page instead of staying static and scrolling with the rest of the content. It's fairly easy to implement, too: the "top" CSS class just needs to be modified from the first code block to the second.

Current CSS:
Code:
.top{ background-color: #1c1c1c; border-bottom: 2px solid #892222; }

Updated with sticky nav:
Code:
.top{ border-bottom: 2px solid #892222; background-color: #1c1c1c; position: fixed; width: 100%; z-index: 5; top: 0 }
It's often the outcasts, the iconoclasts ... those who have the least to lose because they
don't have much in the first place, who feel the new currents and ride them the farthest.


RE: Sticky navbar #2
I like the static navbar, the scrolling one would just take up screen space.

[+] 1 user Likes Pikami's post

RE: Sticky navbar #3
(09-28-2017, 03:56 AM)Pikami Wrote: I like the static navbar, the scrolling one would just take up screen space.

Maybe on mobile, but on desktop it's not that bad:
Spoiler: static nav
[Image: KWC96jp.png]

Spoiler: sticky nav
[Image: AP9MMTj.png]
It's often the outcasts, the iconoclasts ... those who have the least to lose because they
don't have much in the first place, who feel the new currents and ride them the farthest.


RE: Sticky navbar #4
Some users prefer one and not the other and vice-versa.

I don't know If there's a plugin available, but It'll be good If there's an option In the UserCP to enable/disable your preference.
[Image: AD83g1A.png]

[+] 1 user Likes mothered's post

RE: Sticky navbar #5
I've thought of this, and... Now that you've brought it up, I added it to my userstyle: https://userstyles.org/styles/141333/sinisterly

Go to "advanced options" and it'll let you select if you want it or not.


(11-02-2018, 02:51 AM)Skullmeat Wrote: Ok, there no real practical reason for doing this, but that's never stopped me.

[+] 2 users Like Blink's post

RE: Sticky navbar #6
(09-28-2017, 03:04 AM)Inori Wrote: I've been thinking about some CSS tweaks to the site's theme recently, and a big one I think any people would like is a sticky navbar, i.e. one that stays at the top of the page instead of staying static and scrolling with the rest of the content. It's fairly easy to implement, too: the "top" CSS class just needs to be modified from the first code block to the second.

Current CSS:
Code:
.top{    background-color: #1c1c1c;    border-bottom: 2px solid #892222; }

Updated with sticky nav:
Code:
.top{    border-bottom: 2px solid #892222;    background-color: #1c1c1c;    position: fixed;    width: 100%;    z-index: 5;    top: 0 }

There is a problem with your code, that is that it doesn't move the "main" part down. So the top get's cut off.

[+] 1 user Likes Sikom's post

RE: Sticky navbar #7
We considered adding this, funnily enough. I decided to go with a traditional navbar in the end. It's neat that you guys have made spinoffs to suit your personal preference.
[Image: 7ajmN5P.jpg]

Telegram: Oni_SL (Link)


RE: Sticky navbar #8
I was actually trying to replicate this myself, and couldnt get it to work at the time. Thank's for this!
[Image: ezgif_com_gif_maker.gif]
#yellowheartsforsarah


RE: Sticky navbar #9
(09-28-2017, 09:10 AM)Sikom Wrote: There is a problem with your code, that is that it doesn't move the "main" part down. So the top get's cut off.

The code I posted is the general gist of it. To move the rest down you can set the "top" and "position" properties of the header and body content:
Code:
.header,body > .container{ position: relative; top: 45px }



(09-28-2017, 10:44 AM)Oni Wrote: We considered adding this, funnily enough. I decided to go with a traditional navbar in the end. It's neat that you guys have made spinoffs to suit your personal preference.

Theme options tho?
It's often the outcasts, the iconoclasts ... those who have the least to lose because they
don't have much in the first place, who feel the new currents and ride them the farthest.


RE: Sticky navbar #10
It would be nice with an option to disable and or enable it, unsure what I would actually prefeer