inherit
118283
0
Oct 24, 2020 6:55:22 GMT -8
Ishy
470
February 2008
april7291
|
Post by Ishy on Nov 17, 2014 16:41:31 GMT -8
I'm wondering if anyone has a really good (and easy if possible) way to make the navigation menu scroll with the page until the top reaches the top of the site and then scrolls as you scroll down, but remains at the top. I've found two jquery codes and currently have one of them on the site but whenever I scroll down my #wrapper2 keeps jumping. I'm sure my coding isn't perfect so any help organizing and getting it to work flawlessly would be very much appreciated. link
|
|
inherit
133146
0
Nov 16, 2024 15:51:08 GMT -8
Alanna 🥀🖤
3,564
November 2008
alannab
|
Post by Alanna 🥀🖤 on Nov 18, 2014 0:40:11 GMT -8
It looks fine to me but also, elli has already made the exact thing you want before for Adoxography v1. I'd post it for you but I'd rather her do it or okay it first.
|
|
inherit
96289
0
May 17, 2020 9:37:00 GMT -8
elli
1,822
January 2007
ebbymac
|
Post by elli on Nov 25, 2014 22:27:55 GMT -8
Ishy @khristian Feel free to post it!
|
|
inherit
133146
0
Nov 16, 2024 15:51:08 GMT -8
Alanna 🥀🖤
3,564
November 2008
alannab
|
Post by Alanna 🥀🖤 on Nov 25, 2014 23:24:28 GMT -8
Okie dokie! ishy, this is the script that goes in Admin > Structure > Layout Templates > Forum Wrapper directly under the $[head] variable: <script type="text/javascript"> // SCRIPT BY ELLI OF TWICEBAKED // HTTP://TWICEBAKEDFX.COM/ $(document).ready(function(){ var $nav = $("#navigation-bar"); var pos = $nav.position(); $(window).scroll(function() { var windowpos = $(window).scrollTop(); if (windowpos >= pos.top) { $nav.addClass("stick"); } else { $nav.removeClass("stick"); } }); }); </script> And here is the CSS that goes in Admin > Themes > Advanced Styles & CSS > Style Sheet: /* Sticky Menu Bar by Elli of Twicebaked */ #wrapper { margin-top: 50px; } /* This number should be the preferred distance between your header and the menu bar PLUS the height of your menu bar */ #navigation-menu { width: 100%; position: fixed; top: 0; z-index: 9999; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; } .stick { position: fixed !important; bottom: 0 !important; } .container > .control-bar { top: 32px !important; } /* This number is the height of your menu bar */
|
|
inherit
118283
0
Oct 24, 2020 6:55:22 GMT -8
Ishy
470
February 2008
april7291
|
Post by Ishy on Nov 26, 2014 10:01:04 GMT -8
Thank you both so so much!
|
|