Skip to content

Instantly share code, notes, and snippets.

@ivan-kalachikov
Created December 7, 2018 09:07
Show Gist options
  • Save ivan-kalachikov/6aad5a40a72bc1c42579dbb654586611 to your computer and use it in GitHub Desktop.
Save ivan-kalachikov/6aad5a40a72bc1c42579dbb654586611 to your computer and use it in GitHub Desktop.
chat and recaptcha position
//chat and recaptcha position
function chatAndRecaptchaPosition() {
if (!$('html').hasClass('has-cookie-bar cookie-bar-bottom-bar')) {
return;
};
var height = parseInt($('#catapult-cookie-bar').outerHeight());
var styles = '<style>.has-cookie-bar.cookie-bar-bottom-bar body > .container {margin-bottom:' + height + 'px;} .has-cookie-bar.cookie-bar-bottom-bar .mcwidget-embed {bottom:' + parseInt(height - 30) + 'px;} .has-cookie-bar.cookie-bar-bottom-bar .grecaptcha-badge {bottom:' + parseInt(height + 1) + 'px !important;}</style>';
$('#additional-styles').html(styles);
}
$('body').append('<div id="additional-styles"></div>');
$(window).load(function () {
chatAndRecaptchaPosition();
});
$(window).resize(function () {
chatAndRecaptchaPosition();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment