setiframeheight.js 837 B

123456789101112131415161718192021222324252627
  1. /*
  2. $(document).ready(function(){
  3. setTimeout('setHight()', 200);
  4. setTimeout('setHight()', 500);
  5. setTimeout('setHight()', 2000);
  6. setTimeout('setHight()', 10000);
  7. });*/
  8. $(window).load(function(){
  9. setHight();
  10. });
  11. /*window.onload = function(){
  12. alert(333);
  13. setHight();
  14. };*/
  15. function setHight(){
  16. // var _thisHight = $(window.document.body).height()+30;
  17. // var parentH = $(top.document.body).find("iframe").height();
  18. // alert($(parent.document.body).prop("outerHTML"));
  19. // alert(_thisHight+","+parentH);
  20. if(parent==top){
  21. $(parent.document.body).find("#frmright").css("height",$(window.document.body).height()+30);
  22. }
  23. if(parent!=top){
  24. $(parent.document.body).find("#frmrightChild").css("height",$(window.document.body).height()+30);
  25. $(top.document.body).find("#frmright").css("height",$(parent.document.body).height()+30);
  26. }
  27. }