I need to hide some buttons in a parent window while opening modal by clicking image inside an iframe.
Following is my code -
in parent window -
<iframe id="gallery" src="links/gallery.html" width="100%" frameborder="0" style="min-height: 100vh;
max-height: 999px;></iframe>
<div id="max" class="abtbtn">
<button><span class="fas fa-chevron-up"></span></button>
<button><span class="fas fa-chevron-down"></span></button>
</div>
javascript:
var iframe = document.getElementById('gallery').contentWindow.find('img');
iframe.click.document.getElementById("max").style.display = "none";
in iframe -
<img id="portfolio" src="images/portfolios/web/4.jpg" data-toggle="modal" data-target=".portfolio1" alt="" />
I have tried so many ways but nothing works. Please help.. Thanks in advance!