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,
26 initialize: function(name,options){
27 this.setOptions(this.getOptions(), options);
29 this.options.container = $(this.options.container);
30 this.options.tohide = $(this.options.tohide);
32 this.container = new Element('div').addClass(name).
41 zIndex: this.options.zIndex,
44 }).addEvent('click', function(){
45 this.options.onClick()
46 }.bind(this)).injectInside(this.options.container);
48 window.addEvent('resize', this.position.bind(this));
49 window.addEvent('scroll', this.position.bind(this));
53 if(this.options.container == document.body){
54 this.w = window.getWidth();
55 this.h = window.getHeight();
56 this.s = window.getScrollTop();
58 var myCoords = this.options.container.getCoordinates();
59 this.w = myCoords.width;
60 this.h = myCoords.height;
61 this.s = myCoords.top;
63 this.container.setStyles({
69 getCoordinates: function(){
78 if (this.options.tohide) {
79 this.hiddenstyles = this.options.tohide.getStyles(
82 this.options.tohide.setStyles({
86 this.bodystyles = document.body.getStyles(
87 'overflow', 'overflow-x', 'overflow-y'
89 document.body.setStyles({
91 'overflow-x': 'hidden',
92 'overflow-y': 'hidden',
95 this.container.setStyle('display', 'block');
99 if (this.options.tohide) {
100 this.options.tohide.setStyles(this.hiddenstyles);
102 document.body.setStyles(this.bodystyles);
103 this.container.setStyle('display', 'none');
107 return this.container.grab(obj);
110 showWindow.implement(new Options);