Here Ilya made a code for me on Russian support. it's for hiding the help window above the topic - it's an iframe with pictures. the code that I have is the same Ilya works well but slows down the loading of the theme loading the iframe. the new code i posted here is much faster but causes the quick reply buttons to be hidden
you need to fix the code so that the quick reply buttons are not hidden
screenshot iframe
- Code:
<div class='iframe_area'></div>
<div class='btn_iframe'>Скрыть инструкцию</div>
<script>
$(document).ready(function() {
let iframeArea = document.querySelector('.iframe_area');
let btnIframe = $('.btn_iframe');
if (btnIframe.text() === 'Скрыть инструкцию') {
if (iframeArea.querySelector('iframe') === 'null') {
iframeArea.insertAdjacentHTML('beforeend', '<iframe width="700" height="480" src="https://stihi-podval.forumotion.com/h1-page"></iframe>');
}
} else {
iframeArea.querySelector('iframe').remove();
}
btnIframe.click(function() {
if (btnIframe.text() === 'Скрыть инструкцию') {
btnIframe.text('Показать инструкцию');
localStorage.setItem('btniframe','off');
iframeArea.querySelector('iframe').remove();
} else if (btnIframe.text() === 'Показать инструкцию') {
btnIframe.text('Скрыть инструкцию');
localStorage.removeItem('btniframe');
iframeArea.insertAdjacentHTML('beforeend', '<iframe width="700" height="480" src="https://stihi-podval.forumotion.com/h1-page"></iframe>');
};
});
if (localStorage.getItem('btniframe') === 'off') {
btnIframe.text('Показать инструкцию');
iframeArea.querySelector('iframe').remove();
} else {
localStorage.removeItem('btniframe');
iframeArea.insertAdjacentHTML('beforeend', '<iframe width="700" height="480" src="https://stihi-podval.forumotion.com/h1-page"></iframe>');
};
});
</script>
you need to fix the code so that the quick reply buttons are not hidden
screenshot iframe