setiframeheight1.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. var browserVersion = window.navigator.userAgent.toUpperCase();
  2. var isOpera = false;
  3. var isFireFox = false;
  4. var isChrome = false;
  5. var isSafari = false;
  6. var isIE = false;
  7. var iframeTime;
  8. function reinitIframe(iframeId, minHeight) {
  9. try {
  10. var height = $(window.document.body).height();
  11. if (height < minHeight) {
  12. height = minHeight;
  13. }
  14. $(top.document.body).find("#frmright").height(height+30);
  15. } catch (ex) { }
  16. }
  17. function startInit(iframeId, minHeight) {
  18. isOpera = browserVersion.indexOf("OPERA") > -1 ? true : false;
  19. isFireFox = browserVersion.indexOf("FIREFOX") > -1 ? true : false;
  20. isChrome = browserVersion.indexOf("CHROME") > -1 ? true : false;
  21. isSafari = browserVersion.indexOf("SAFARI") > -1 ? true : false;
  22. if (!!window.ActiveXObject || "ActiveXObject" in window)
  23. isIE = true;
  24. reinitIframe(iframeId, minHeight);
  25. if (iframeTime != null)
  26. clearInterval(iframeTime);
  27. iframeTime = window.setInterval("reinitIframe('" + iframeId + "'," + minHeight + ")", 500);
  28. }
  29. $(function(){
  30. startInit("frmright",450);
  31. window.setTimeout("clearInterval(iframeTime)", 5000);
  32. });