人人商城

module_setting.html 992B

123456789101112131415161718192021222324252627282930313233
  1. {template 'common/header'}
  2. <div class="main">
  3. <div class="clearfix">
  4. <iframe id="iframe" name="iframe" src="" style="margin-bottom: 0px;" marginheight="0" marginwidth="0" frameborder="0" scrolling="auto" width="100%" height="100%" allowTransparency="true" >
  5. </iframe>
  6. </div>
  7. </div>
  8. <script>
  9. function autoHeightIFrameNavigate(iframeId,url) {
  10. var iframe = $('#'+iframeId);
  11. iframe.attr('_name_',iframe.attr('name'));
  12. iframe.attr('src',url);
  13. iframe.one('load',function(){
  14. this.contentWindow.location = "about:blank";
  15. $(this).one('load',function(){
  16. var msg = this.contentWindow.name;
  17. this.contentWindow.name = $(this).attr('_name_');
  18. this.contentWindow.location = url;
  19. try{
  20. var height = eval(msg);
  21. iframe.css('height',height + 'px');
  22. }catch(e){
  23. iframe.css('height', '1000px');
  24. }
  25. });
  26. });
  27. }
  28. $(function(){
  29. $('#iframe').css('min-height', $(window).height()-140);
  30. autoHeightIFrameNavigate('iframe','{$iframe}');
  31. });
  32. </script>
  33. {template 'common/footer'}