Tagged: x
-
AuthorPosts
-
July 9, 2016 at 4:33 pm #1079568
TimmyParticipantHi!
I just can’t figure it out. I want my navbar font to change color when scrolling, no problem with that but it doesn’t change back the original color when scrolling all the way up again.
My CSS-code right now is:
.x-navbar .x-nav-wrap.desktop li a span { color: #fff; } .x-navbar.x-navbar-fixed-top .x-nav-wrap.desktop li a span { color: #2b2b2b; }URL: http://timanity.se/
Thanks in advance!
TimmyJuly 10, 2016 at 1:36 am #1079918
ChristopherModeratorHi there,
Please remove CSS and add this code in Custom -> JavaScript :
jQuery(document).ready(function($){ $(window).scroll(function(){ if ($(this).scrollTop() > 50) { $('.x-navbar li a').css("color","#2b2b2b"); } else { $('.x-navbar li a').css("color","#fff"); } }); });Hope that helps.
July 10, 2016 at 6:09 am #1080071
TimmyParticipantThank you soo much!! 🙂
July 10, 2016 at 6:19 am #1080076
ChristopherModeratorYou’re welcome.
July 10, 2016 at 6:23 am #1080078
TimmyParticipantKind of helped me!
But the problem now is that when the page loads up it looks like this:

When I scroll down it’s good:

And when I scroll up again, same thing it looks perfect:

So why isn’t the links white when the page loads up?
July 10, 2016 at 6:45 am #1080088
ChristopherModeratorPlease update JS code to :
jQuery(document).ready(function($){ $(window).scroll(function(){ if ($(this).scrollTop() > 50) { $('.x-navbar.x-navbar-fixed-top li a span').css("color","#2b2b2b"); } else { $('.x-navbar.x-navbar-fixed-top li a span').css("color","#fff"); } }); });Add this CSS as well :
.x-navbar li a span{ color:#fff; }Hope it helps.
July 10, 2016 at 12:53 pm #1080355
TimmyParticipantAwesome! Thank you soo much!! 😀
July 10, 2016 at 1:27 pm #1080379
RupokMemberYou are welcome!
Glad that it helped. Feel free to let us know if you face any other issue. We’ll be happy to assist you.
Thanks for using X.
Cheers!
July 11, 2016 at 11:55 am #1081749
TimmyParticipantHello again!
is it possible to have this on only one page? 🙂
July 11, 2016 at 2:25 pm #1081977
JoaoModeratorHi There,
Yes it is.
Would you mind letting us know which page you would like to achieve this effect?
If it is your home page try using this code instead:
jQuery(document).ready(function($){ $(window).scroll(function(){ if ($(this).scrollTop() > 50) { $('.home .x-navbar.x-navbar-fixed-top li a span').css("color","#2b2b2b"); } else { $('.home.x-navbar.x-navbar-fixed-top li a span').css("color","#fff"); } }); });Let us know how it goes.
Thanks
Joao
July 12, 2016 at 12:49 pm #1083501
TimmyParticipant.page-id-53 is the one I want to achieve it on 🙂
July 12, 2016 at 2:35 pm #1083654
JoaoModeratorHi There,
Try this instead:
jQuery(document).ready(function($){ $(window).scroll(function(){ if ($(this).scrollTop() > 50) { $('.page-id-53 .x-navbar.x-navbar-fixed-top li a span').css("color","#2b2b2b"); } else { $('.page-id-53 .x-navbar.x-navbar-fixed-top li a span').css("color","#fff"); } }); });Hope that helps
Joao
July 12, 2016 at 2:47 pm #1083670
TimmyParticipantYes! Awesome! Thank you! 🙂
July 12, 2016 at 9:47 pm #1084133
NicoModeratorHappy to hear that.
Feel free to ask us again
Thanks.
August 5, 2016 at 8:06 am #1118818
TimmyParticipantHi again!
I have a drop-down menu and the links inside doesn’t show on the home page. P.S Is there a way to make the navbar not transparent when you click on the drop-down menu on mobile?
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1079568 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
