Button + iframe
2017-09-19, 02:20 AM,
(This post was last modified: 2017-09-20, 12:09 PM by hopsa.)
#1
So i'll add a button on my site and when they click on it, the button go away and the site that's linked on the button comes in an iframe.

Can someone help me with the html code please?

[Image: banner-lpb.gif]
Reply
2017-09-19, 03:07 AM,
#2
<script src="https://code.jquery.com/jquery-3.1.0.js"></script>

<button id="my_button" onClick="show_iframe();">click me to show iframe</button>
<iframe id="my_iframe" src="http://www.example.com" style="display:none;"></iframe>

<script type="text/javascript">
var show_iframe = function(){
$('#my_button').hide();
$('#my_iframe').show();
}
</script>
Latest Thanks - View all

2workhard(2017-09-19 05:55 AM) 
Reply
2017-09-20, 12:07 PM,
#3
when I click on the button the site doesn't open??

[Image: banner-lpb.gif]
Reply
2017-09-21, 07:18 PM,
#4
(2017-09-20, 12:07 PM)hopsa Wrote: when I click on the button the site doesn't open??

Try this way:
<script>
var show_iframe = function(){
$('#my_button').hide();
$("#my_iframe").removeAttr("style");
}

</script>

Also, make sure the iframe is not blocked by AdBlock or some other ad-blocking plugin.
Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  Lockers (with iframe and without) help needed. Will pay with PP bebriukas 1 901 2016-11-26, 02:56 PM
Last Post: MIG92
  Mobile traffic redirect after clicks on button Warriorcpa 2 1,091 2016-10-01, 05:54 PM
Last Post: Warriorcpa
  [HELP] How to make iframe 100% height and width ? ashu55 5 1,026 2016-07-02, 09:13 PM
Last Post: ashu55
  i need help in button Cpagrip vip2 6 996 2015-11-24, 07:38 PM
Last Post: SiriusBlack
  Facebook share button locker neroazzurro 2 817 2015-11-05, 02:01 AM
Last Post: SiriusBlack




About Us | Contact Us | CPA Elites | Advertise | Stats | Staff Team

© 2013-2017 CPA Elites Ltd
Enhanced by MyBB and WallBB
Return to top