Silki
view release on metacpan or search on metacpan
share/js-source/Widget/Lightbox2.js view on Meta::CPAN
}
Widget.Lightbox2 = function (params) {
this.browser = new Silki.Browser;
this._initialize(params);
return this;
};
Widget.Lightbox2.prototype._initialize = function (params) {
var overlay = document.createElement("div");
var opacity_val = params.opacity;
if ( typeof opacity_val == "undefined" ) {
opacity_val = 0.7;
}
var color_val = params.color;
if ( typeof color_val == "undefined" ) {
color_val = "#333";
}
var content = params.sourceElement;
if ( ! content ) {
throw "Must provide a sourceElement parameter when making a Widget.Lightbox2 object";
}
DOM.Element.hide(overlay);
var body = document.getElementsByTagName("body")[0];
body.appendChild(overlay);
with ( overlay.style ) {
position = "fixed";
width = "100%";
height = "100%";
top = 0;
left = 0;
padding = 0;
margin = 0;
border = 0;
zIndex = 1000;
opacity = opacity_val;
share/js-source/Widget/Lightbox2.js view on Meta::CPAN
e.preventDefault();
if ( e.stopPropogation ) {
e.stopPropagation();
}
}
);
}
}
this.overlay = overlay;
this.content = content;
};
Widget.Lightbox2.prototype.show = function () {
if ( this.iframe ) {
DOM.Element.show( this.iframe );
}
DOM.Element.show( this.overlay );
DOM.Element.show( this.content );
var left = ( document.body.clientWidth - this.content.offsetWidth ) / 2;
this.content.style.left = left + "px";
window.scroll( 0, 0 );
};
Widget.Lightbox2.prototype.hide = function () {
DOM.Element.hide( this.content );
DOM.Element.hide( this.overlay );
if ( this.iframe ) {
DOM.Element.hide( this.iframe );
}
};
( run in 1.021 second using v1.01-cache-2.11-cpan-49f99fa48dc )