So, I'm trying to make it so that when an element (inside the iframe) becomes hidden (display: none), it would make the iframe have display none.
I've tried:
var iframe = $('.preloader').contents().find('*');
if((iframe).is(':hidden')) {
$('.preloader').css('display','none');
}
and
if($('.preloader').contents().find('*').is(':hidden')) {
$('.preloader').css('display','none');
}
These both do not work.
HTML
<iframe class="preloader" src="https://sorrycantsay.net/preloader"></iframe>
This may help: