Tagged: x
-
AuthorPosts
-
September 12, 2016 at 3:18 am #1170983
AdvasaParticipantHello
I am using the top bar of a website for the business phone number and would like it to be sticky on mobile.
How can I achieve this?Thanks
Justin
September 12, 2016 at 3:19 am #1170985
AdvasaParticipantThis reply has been marked as private.September 12, 2016 at 3:37 am #1171016
ChristopherModeratorHi there,
Please add following code in Customize -> Custom -> JavaScript :
jQuery(document).ready(function($){ $(window).scroll(function(){ if ($(this).scrollTop() > 50) { $('.x-topbar').addClass("x-navbar-fixed-top"); } else { $('.x-topbar').removeClass("x-navbar-fixed-top"); } }); });Please add following code in Customize -> Custom -> CSS :
.x-topbar.x-navbar-fixed-top{ position:fixed; top:0; right:0; left:0; }Hope that helps.
September 12, 2016 at 6:00 am #1171159
AdvasaParticipantThank you that worked perfectly 🙂
September 12, 2016 at 6:16 am #1171171
ThaiModeratorGlad it worked 🙂
If you need anything else please let us know.
September 12, 2016 at 7:54 am #1171253
AdvasaParticipantCome to think of it how can I make the top bar sticky on all devices instead of just mobile??
Thanks
Justin
September 12, 2016 at 8:39 am #1171327
ThaiModeratorHi Justin,
Please also add the following CSS:
.x-navbar.x-navbar-fixed-top { top: 51px; }Hope it helps 🙂
September 12, 2016 at 9:18 am #1171367
AdvasaParticipantThanks!
September 12, 2016 at 9:39 am #1171409
RahulModeratorYou’re most welcome!
Let us know if you have anything else to ask.
Thanks for using the X theme!
September 12, 2016 at 9:49 am #1171430
AdvasaParticipantThank you
How can I make the .x-icon-plus-circle that links the the header widget sticky on mobile as well?
Cheers
Justin
September 12, 2016 at 1:35 pm #1171854
JadeModeratorHi Justin,
You can add this under Custom > CSS in the Customizer.
@media (max-width: 767px) { .x-widgetbar .x-widgetbar-inner { position: fixed; } }Hope this helps.
September 13, 2016 at 3:21 am #1172681
AdvasaParticipantHello
I tried adding that code and it didn’t work, when I scroll down on mobile the image disappears.
Thanks
Justin
September 13, 2016 at 5:16 am #1172807
ChristopherModeratorHi there,
Please try this code :
.x-btn-widgetbar { position: fixed; }Hope it helps.
September 14, 2016 at 7:23 pm #1175649
AdvasaParticipantHello
Thanks that made it sticky but when I slide the screen down it becomes unclickable.
How can I fix this?Thanks
Justin
September 15, 2016 at 12:17 am #1176078
LelyModeratorHello Justin,
Please update above CSS to this:
.x-btn-widgetbar { position: fixed; z-index:99999; } .x-widgetbar-inner { position: fixed; }Hope this helps.
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1170983 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
