Hello there,
Yes, you can do this by adding the Javascript code below to X > Launch > Options > JS:
jQuery( document ).ready(function($) {
$('.x-bar-fixed').css("background-color", "#fffddf");
$( window ).scroll(function() {
if ($( this ).scrollTop() > YOUR_PIXELS_HERE) {
$('.x-bar-fixed').css("background-color", "YOUR_BACKGROUND_COLOR").css("transition","0.3s ease-in-out "); }
else if ($( this ).scrollTop() > YOUR_PIXELS_HERE) {
$('.x-bar-fixed').css("background-color", "YOUR_BACKGROUND_COLOR").css("transition","0.3s ease-in-out "); }
else if ($( this ).scrollTop() > YOUR_PIXELS_HERE) {
$('.x-bar-fixed').css("background-color", "YOUR_BACKGROUND_COLOR").css("transition","0.3s ease-in-out "); }
else if ($( this ).scrollTop() > YOUR_PIXELS_HERE) {
$('.x-bar-fixed').css("background-color", "YOUR_BACKGROUND_COLOR").css("transition","0.3s ease-in-out "); }
else {
$('.x-bar-fixed').css("background-color", "#fffddf").css("transition","0.3s ease-in-out "); } });
});
Then change YOUR_BACKGROUND_COLOR
and YOUR_PIXELS_HERE
to the values needed.
Please take note that pixels should be numeric values only. E.g. 400
You can add more pixel if you want by duplicating a line of else if
.
else if ($( this ).scrollTop() > YOUR_PIXELS_HERE) {
$('.x-bar-fixed').css("background-color", "YOUR_BACKGROUND_COLOR").css("transition","0.3s ease-in-out "); }
And of course, just retain the CSS code provided a while ago:
.x-bar-fixed {
background-color: #fffddf !important;
}
Hope it helps.