1

i have this code in my single.php page of wordpress for pop-up on click an <iframe> on external site.

<a class="lbp-inline-link-1 cboxElement et_pb_pricing_table_button" href="#">Click_and_see_site</a>
<div style="display: none;">
<div id="lbp-inline-href-1" style="padding:10px; background: #fff;">
<iframe id="MyId" src="<?php echo $url_site; ?>" frameborder="0" style="height:97%;width:100%;position:absolute;top:0px;left:0px;right:0px;bottom:0px" height="97%" width="100%"></iframe>
</div>
</div>

I want load iframe only when pressed on "Click_and_see_site"

1 Answer 1

1

Try this :

$(".lbp-inline-link-1").on('click',function (){

 $("#MyId").prop('src','<?php echo $url_site; ?>');
});

Also remove the SRC :

<iframe id="MyId" src="about:blank" ...
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.