From: Eugene Crosser Date: Mon, 25 Aug 2008 11:40:26 +0000 (+0000) Subject: more correct sizing; simplify doc structure X-Git-Tag: 2.00~43 X-Git-Url: http://www.average.org/gitweb/?p=mkgallery.git;a=commitdiff_plain;h=ab432814a482877e9ec4fc066ac113120e5ef1cf more correct sizing; simplify doc structure --- diff --git a/include/gallery.css b/include/gallery.css index c863c19..8503ddf 100644 --- a/include/gallery.css +++ b/include/gallery.css @@ -77,14 +77,9 @@ table.picframe { background: url(loading.gif) center no-repeat; } -.slideshowWindow { - background-color: black; -} - .slideshowContainer { - padding-bottom: 32px; + background-color: black; width: 100%; - height: 100%; } .slideshowControls { @@ -93,8 +88,12 @@ table.picframe { left: 0px; width: 100%; height: 30px; - border-top: 1px solid white; z-index: 3; + opacity: .15; +} + +.slideshowControls:hover { + opacity: 1; } .controlButton { diff --git a/include/gallery.js b/include/gallery.js index 690ac57..445a826 100644 --- a/include/gallery.js +++ b/include/gallery.js @@ -26,7 +26,11 @@ var showWindow = new Class({ this.options.container = $(this.options.container) - this.container = new Element('div').addClass(name).setStyles({ + this.container = new Element('div').addClass(name). + setProperties({ + id: name, + name: name, + }).setStyles({ position: 'absolute', left: '0px', top: '0px', @@ -38,12 +42,14 @@ var showWindow = new Class({ this.options.onClick() }.bind(this)).injectInside(this.options.container); + this.embedded = [] this.options.embed.each(function(el){ var sub = new Element('div') sub.addClass(el).setProperties({ id: el, name: el, }).injectInside(this.container) + this.embedded.push(sub) },this) this.position() @@ -54,18 +60,17 @@ var showWindow = new Class({ position: function(){ if(this.options.container == document.body){ - var h = window.getHeight()+'px' - var s = window.getScrollTop()+'px' - this.container.setStyles({top: s, height: h}) + this.h = window.getHeight() + this.s = window.getScrollTop() }else{ var myCoords = this.options.container.getCoordinates() - this.container.setStyles({ - top: myCoords.top+'px', - height: myCoords.height+'px', - left: myCoords.left+'px', - width: myCoords.width+'px' - }) + this.h = myCoords.height + this.s = myCoords.top } + this.container.setStyles({ + top: this.s+'px', + height: this.h+'px' + }) }, show: function(){ @@ -231,9 +236,9 @@ function init_gallery() { var winparms = { /* onClick: showStop, /* temporarily */ - embed: ['slideshowContainer', 'slideshowControls'], + embed: ['slideshowControls'], } - showwin = new showWindow('slideshowWindow',winparms) + showwin = new showWindow('slideshowContainer',winparms) var showparms = { wait: 3000, diff --git a/include/slideshow.js b/include/slideshow.js index 0b19b6b..2de9fee 100644 --- a/include/slideshow.js +++ b/include/slideshow.js @@ -33,7 +33,7 @@ var slideShow = new Class({ this.container = $(container); this.container.setStyles({ - position: 'relative', + /* position: 'relative', */ overflow: 'hidden' }); if(this.options.onClick){ @@ -173,8 +173,10 @@ var slideShow = new Class({ if (vfactor < factor) { factor = vfactor; } if (hfactor < factor) { factor = hfactor; } factor *= .95; - height = Math.round(height * factor); - width = Math.round(width * factor); + if (factor < 1) { + height = Math.round(height * factor); + width = Math.round(width * factor); + } var topoff = (this.height - height)/2; var leftoff = (this.width - width)/2; /* alert('dim: '+width+'x'+height+'+'+leftoff+'+'+topoff); */