Bsoft  2.1.0
Bernard's software package
bsoft.js
Go to the documentation of this file.
1 // Bsoft javascript library
2 // Created: 20110305
3 // Modified: 20110305
4 // Bernard Heymann
5 
6 function changeIframeContent(id, url) {
7  var iframe = document.getElementById(id);
8  if ( iframe && iframe.src ) {
9  iframe.src = url;
10  return false;
11  }
12  return true;
13 }
14 
15 // The id refers to the id tag in Safari and the name tag in Firefox
16 function resizeIframe(id, tx, ty) {
17  var iframe = document.getElementById(id);
18  if ( window.frames[id] && window.frames[id].document) {
19  var body = window.frames[id].document.body;
20  if ( body ) {
21  var obj = (iframe.style) ? iframe.style : iframe;
22  obj.width = window.innerWidth - tx + 'px';
23  obj.height = window.innerHeight - ty + 'px';
24  } else {
25  alert("body not found!");
26  }
27  } else {
28  alert("iframe " + id + " not found!");
29  }
30 }
31 
32 function setIFrameSize(id) {
33  f = $("ifrm2");
34  f[0].setAttribute("width", f.parent().width());
35  f[0].setAttribute("height", f.parent().height());
36 }