iFrame url to through div show and hide on page and template
We have developed custom code for iframe url to through div class show/display and hide on page, Use this below iframe url base code for condition match url on iframe src code.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.3/jquery.min.js"></script>
<script>
jQuery(document).ready(function() {
var myurl = 'https://example.com';
var currentURL = document.getElementById("iframe-login").src;
if(myurl == currentURL) {
jQuery('#logout-menu').hide();
}
else{
jQuery('#logout-menu').show();
}
});
</script>
Below html iframe src code, you can use this one code on your page and template file.
<iframe id="iframe-login" name="" src="https://example.com" width="100%" height="500"></iframe>
0 Comments