2013-12-17 218 views
0

我正在尝试将游戏整合到我的phpfox社交网络中。这是它的代码是由第三方,是这样的事情是这样的动态增加iframe高度

<script type="text/javascript"> 
      $(document).ready(function(){    
       $('body').append('<iframe id="crossdomain_frame" src="<?php echo APP_URL; ?>static/crossdomain.php?height=' + document.body.scrollHeight + '&nocache=' + Math.random() + '" height="0" width="0" frameborder="0"></iframe>'); 
      });  
     </script> 

在设置事情框架的高度是搞砸了。我无法理解如何增加身高。在加载时查看页面源代码,我发现在页面中甚至没有heightwidth属性。任何人都可以帮忙吗?

P.S您可以通过打开http://social.techbreeze.in/index.php?do=/apps/4/candy-rush/并使用您的Facebook帐户登录来查看页面的外观。

回答

0

您可以使用jQuery设置iframe的高度,你追加iframe来身上。之后,

$(document).ready(function(){    
     $('body').append('<iframe id="crossdomain_frame" src="<?php echo APP_URL; ?>static/crossdomain.php?height=' + document.body.scrollHeight + '&nocache=' + Math.random() + '" height="0" width="0" frameborder="0"></iframe>'); 
     $('#crossdomain_frame').css('height', $(window).height()+'px'); 
});