Hello!
I’d like the info bar from Converplug to push the page down with a sticky header, on desktop and on mobile.
I inserted this CSS:
/*
// Navbar fixed with infobar
*/
.x-navbar-fixed-top {
-webkit-transition: all 500ms ease-out 1s;
-moz-transition: all 500ms ease-out 1s;
-o-transition: all 500ms ease-out 1s;
transition: all 500ms ease-out 1s;
}
.with-cp-top .x-navbar-fixed-top {
top: 60px;
}
.with-cp-top.admin-bar .x-navbar-fixed-top {
top: 83px;
}
@media (max-width: 979px) {
.with-cp-top .x-navbar-fixed-top {
top: 150px;
}
}
And this Javascript:
jQuery ( function($) {
function apply_cp_top () {
if ( $(’.cp-info-bar’).length > 0 ) {
$( ‘body’ ).addClass(‘with-cp-top’);
} else {
$( ‘body’ ).removeClass(‘with-cp-top’);
}
}
$(document).ready ( function() { apply_cp_top (); } );
$(’.ib-img-close img’).on(‘click’, function() { console.log(‘closed’); $( ‘body’ ).removeClass(‘with-cp-top’); } );
} );
Would you say it is correct?
It seems ti do the job but sometimes the info bar acts strangely (like leaving some empty space to the top).
Thank you in advance!
Gabriele