I am facing a challenge with embedding a facebook iframe on my website. I want to disable it once the screen width reaches a specific point, but I am struggling to make the iframe disappear properly. Here is how I have attempted to implement this:
window.onresize = () => {
if (window.innerWidth <= 1200) {
document.getElementsByClassName("fb-page")[0].setAttribute("data-height", "0");
}
else {
document.getElementsByClassName("fb-page")[0].setAttribute("data-height", "130");
}
However, this solution is not working as expected because the minimum height set for the iframe is 70 and it does not refresh itself. Do you have any suggestions on how to fix this issue?