/[webpac]/trunk2/out/js/iframe.js
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk2/out/js/iframe.js

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 577 by dpavlin, Mon Nov 1 18:00:26 2004 UTC revision 578 by dpavlin, Mon Nov 1 22:15:20 2004 UTC
# Line 29  function iframe_height(name) { Line 29  function iframe_height(name) {
29    
30          if (doc.body) {          if (doc.body) {
31                  var h = -1;                  var h = -1;
32                    var h1 = -1;
33    
34                  if (doc.body.scrollHeight) {                  if (doc.body.scrollHeight) {
35                          h = parseInt(doc.body.scrollHeight) || -1;                          h1 = parseInt(doc.body.scrollHeight) || -1;
36                            //alert(name+" scrollHeight "+h1);
37                            if (h1 > h) h = h1;
38                  }                  }
39                  if (h < 0 && doc.body.clientHeight) {                  if (doc.body.clientHeight) {
40                          h = parseInt(doc.body.clientHeight) || -1;                          h1 = parseInt(doc.body.clientHeight) || -1;
41                            //alert(name+" clientHeight "+h1);
42                            if (h1 > h) h = h1;
43                  }                  }
44    
45                  return h;  /*
46                    var elm = document.getElementById(name);
47                    if (elm) {
48                            elm.style.height = 'auto';
49                            h1 = elm.offsetHeight;
50                            alert(name+" offsetHeight "+h1);
51                            if (h1 > h) h = h1;
52                    }
53    */
54    
55                    return h + 20;
56    
57          }          }
58          return 50;          return 50;
59  }  }
60    
61  function iframe_resize(name) {  function iframe_resize(name) {
         if (! iframe_id(name).src) return;  
62    
63          iframe_id(name).style.height = String(iframe_height(name)+'px');          var el=iframe_id(name);
64    
65            if (! el || ! el.src) return;
66    
67            el.style.height = String(iframe_height(name)+'px');
68  }  }
69    
70  function iframe_load(name,url) {  function iframe_load(name,url) {
71    
72          if (! name || ! url) return false;          if (! name || ! url) return false;
73    
74          iframe_id(name).src = url;          var el=iframe_id(name);
75    
76            if (! el) alert("can't find element "+name);
77    
78            // is there src, and is src same?
79            if (el.src && el.src.substr(el.src.length - url.length) == url) return false;
80    
81            el.style.height = '0px';
82            el.src = url;
83    
84          return false;          return false;
85  }  }

Legend:
Removed from v.577  
changed lines
  Added in v.578

  ViewVC Help
Powered by ViewVC 1.1.26