4 This is a part of mkgallery.pl suite
5 http://www.average.org/mkgallery/
7 Uses mootools (1.2) http://www.mootools.net/
8 Uses slideshow http://www.phatfusion.net/slideshow/
12 Hideable "fullscreen" Window for Slideshow
15 var showWindow = new Class({
17 getOptions: function(){
20 container: document.body,
27 initialize: function(name,options){
28 this.setOptions(this.getOptions(), options);
30 this.options.container = $(this.options.container);
31 this.options.tohide = $(this.options.tohide);
33 this.container = new Element('div').addClass(name).
42 zIndex: this.options.zIndex,
45 }).addEvent('click', function(){
46 this.options.onClick()
47 }.bind(this)).addEvent('keypress', function(){
48 this.options.onKeypress()
49 }.bind(this)).injectInside(this.options.container);
51 window.addEvent('resize', this.position.bind(this));
52 window.addEvent('scroll', this.position.bind(this));
56 if(this.options.container == document.body){
57 this.w = window.getWidth();
58 this.h = window.getHeight();
59 this.s = window.getScrollTop();
61 var myCoords = this.options.container.getCoordinates();
62 this.w = myCoords.width;
63 this.h = myCoords.height;
64 this.s = myCoords.top;
66 this.container.setStyles({
72 getCoordinates: function(){
81 if (this.options.tohide) {
82 this.hiddenstyles = this.options.tohide.getStyles(
85 this.options.tohide.setStyles({
89 this.bodystyles = document.body.getStyles(
90 'overflow', 'overflow-x', 'overflow-y'
92 document.body.setStyles({
94 'overflow-x': 'hidden',
95 'overflow-y': 'hidden',
98 this.container.setStyle('display', 'block');
102 if (this.options.tohide) {
103 this.options.tohide.setStyles(this.hiddenstyles);
105 document.body.setStyles(this.bodystyles);
106 this.container.setStyle('display', 'none');
109 showWindow.implement(new Options);