Created
December 7, 2018 09:07
-
-
Save ivan-kalachikov/6aad5a40a72bc1c42579dbb654586611 to your computer and use it in GitHub Desktop.
chat and recaptcha position
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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