Responsive iFrame for iframing CPA or Affiliate Offers

Faceless Men

Senior Member
Joined
Nov 18, 2016
Messages
1,041
Reaction score
996
I use this script to promote cpa offers on bing ads. Let me know if this works on adwords or facebook ads.

Demo: https://iframedemo.netlify.com/

HTML:
<!doctype html>
<html lang="en" class="no-js">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="chrome=1">
    <title>iframe</title>
    <meta name="robots" content="noindex, follow" />
    <meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1" />
    <script src="https://cdn.jsdelivr.net/gh/jquery/[email protected]/dist/jquery.min.js"></script>
    <script src="https://cdn.jsdelivr.net/gh/jquery/[email protected]/dist/sizzle.min.js"></script>
    <script>
      var calcHeight = function() {
        var headerDimensions = $('.preview__header').height();
        $('.full-screen-preview__frame').height($(window).height() - headerDimensions);
      }
      $(document).ready(function() {
        calcHeight();
      });
      $(window).resize(function() {
        calcHeight();
      }).load(function() {
        calcHeight();
      });
    </script>
    <style type="text/css">
        .full-screen-preview{height:100%;padding:0px;margin:0px;overflow:hidden}.full-screen-preview__frame{width:100%;background-color:white}.full-screen-preview__frame.-ios-fix{width:10px;min-width:100%;-webkit-overflow-scrolling:touch;height:100% !important}.preview__header{font-size:12px;height:54px;background-color:#262626;z-index:100;line-height:54px;margin-bottom:1px}.preview__envato-logo{float:left;padding:0 20px}.preview__envato-logo a{display:inline-block;position:absolute;top:18px;text-indent:-9999px;height:18px;width:152px;background:url(https://public-assets.envato-static.com/assets/logos/envato_market-a5ace93f8482e885ae008eb481b9451d379599dfed24868e52b6b2d66f5cf633.svg);background-size:152px 18px}@media (max-width: 568px){.preview__envato-logo{padding:0 10px}.preview__envato-logo a{position:absolute;top:20px;left:15px;height:14px;width:118px;background-size:118px 14px}}.preview__actions{float:right}.preview__action--buy,.preview__action--close{display:inline-block;padding:0 20px}@media (max-width: 568px){.preview__action--buy{padding:0 10px}}.preview__action--purchase-form{display:inline-block}.preview__action--item-details{display:inline-block}.preview__action--close{border-left:1px solid #333333}.preview__action--close a{color:#999999;text-decoration:none}.preview__action--close a:hover{color:white}.preview__action--close a i{color:white;font-size:10px;margin-right:10px}@media (max-width: 568px){.preview__action--close a i{margin-right:0}}@media (max-width: 568px){.preview__action--close a span{display:none}}.screenshots{padding:80px 10px 25px}.screenshots__thumbnail{display:inline-block;margin:0 10px 20px 0;border:1px solid #333333;line-height:0}.screenshots__thumbnail:hover{border:1px solid #666666}.screenshots__fullsize{display:inline-block;margin:20px 0;border:1px solid #333333;line-height:0}.screenshots__fullsize>img{max-width:100%}.screenshots__description{max-width:1024px;margin-top:20px;color:white}body{background-color:black}
    </style>
</head>
<body class="full-screen-preview"> <iframe class="full-screen-preview__frame" src="https://charlesngo.com" name="preview-frame" frameborder="0" noresize="noresize" data-view="fullScreenPreview"> </iframe>
    <script>
        $(function(){viewloader.execute(Views);});
    </script>
    <script>
        (function(){if(typeof newrelic!=='undefined'){newrelic.setCustomAttribute('pageType','other')}})()
    </script>
</body>
</html>
 
Last edited:
Back
Top