dcontainer.js
Summary
No overview generated for 'dcontainer.js'
var dContainer_Debug = false;
function dContainer(name) {
if (dContainer_Debug) alert("Constructing dContainer named '" + name + "'.");
this.name = name;
this.width = 0;
this.height = 0;
this.scroll = false;
this.style = null;
this.container = null;
this.anchor = null;
}
dContainer.prototype.initialize = function() {
this.anchor = window.xGetElementById(this.name);
this.anchor.parentObject = this;
this.width = xWidth(this.anchor);
this.height = xHeight(this.anchor);
this.container = document.createElement('div');
this.container.id = this.name + "_container";
this.container.parentObject = this;
if (this.style) this.container.style.cssText = this.style;
this.container.style.position = 'absolute';
if (this.scroll) this.container.style.overflow = 'AUTO';
document.body.appendChild(this.container);
xResizeTo(this.container, this.width, this.height);
xMoveTo(this.container, xPageX(this.anchor), xPageY(this.anchor));
xClip(this.container, 0, this.width, this.height, 0);
xShow(this.container);
}
dContainer.prototype.sync = function() {
xResizeTo(this.container, this.width, this.height);
xMoveTo(this.container, xPageX(this.anchor), xPageY(this.anchor));
xClip(this.container, 0, this.width, this.height, 0);
}
dContainer.prototype.setContent = function(content) {
if (content.indexOf("http://") == 0 || content.indexOf("https://") == 0 || content.indexOf("ftp://") == 0) {
var text;
var xml;
if (document.all) {
xml = new ActiveXObject("Microsoft.XMLHTTP");
xml.Open("GET", content, false);
xml.Send()
text = xml.responseText;
} else {
xml = new XMLHttpRequest();
xml.open("GET", content, false);
xml.send(null);
text = xml.responseText;
}
xInnerHtml(this.container, text);
} else {
xInnerHtml(this.container, content);
}
}
Documentation generated by
JSDoc on Fri May 5 14:01:20 2006