]> www.average.org Git - mkgallery.git/commitdiff
more correct sizing; simplify doc structure
authorEugene Crosser <crosser@average.org>
Mon, 25 Aug 2008 11:40:26 +0000 (11:40 +0000)
committerEugene Crosser <crosser@average.org>
Mon, 25 Aug 2008 11:40:26 +0000 (11:40 +0000)
include/gallery.css
include/gallery.js
include/slideshow.js

index c863c1972f0234be32347843c8bf9b4aec328db1..8503ddf2a1c9cd41645361924ae2d182673a4b0e 100644 (file)
@@ -77,14 +77,9 @@ table.picframe {
  background: url(loading.gif) center no-repeat;
 }
 
  background: url(loading.gif) center no-repeat;
 }
 
-.slideshowWindow {
- background-color: black;
-}
-
 .slideshowContainer {
 .slideshowContainer {
padding-bottom: 32px;
background-color: black;
  width: 100%;
  width: 100%;
- height: 100%;
 }
 
 .slideshowControls {
 }
 
 .slideshowControls {
@@ -93,8 +88,12 @@ table.picframe {
  left: 0px;
  width: 100%;
  height: 30px;
  left: 0px;
  width: 100%;
  height: 30px;
- border-top: 1px solid white;
  z-index: 3;
  z-index: 3;
+ opacity: .15;
+}
+
+.slideshowControls:hover {
+ opacity: 1;
 }
 
 .controlButton {
 }
 
 .controlButton {
index 690ac57dfb24ddda6893bdd7518acfa49a30f98a..445a826aa9f773beeb58cc418727f476547b92dc 100644 (file)
@@ -26,7 +26,11 @@ var showWindow = new Class({
 
                this.options.container = $(this.options.container)
 
 
                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',
                        position: 'absolute',
                        left: '0px',
                        top: '0px',
@@ -38,12 +42,14 @@ var showWindow = new Class({
                        this.options.onClick()
                }.bind(this)).injectInside(this.options.container);
 
                        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.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()
                },this)
 
                this.position()
@@ -54,18 +60,17 @@ var showWindow = new Class({
 
        position: function(){
                if(this.options.container == document.body){
 
        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()
                }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(){
        },
 
        show: function(){
@@ -231,9 +236,9 @@ function init_gallery() {
 
  var winparms = {
   /* onClick: showStop,  /* temporarily */
 
  var winparms = {
   /* onClick: showStop,  /* temporarily */
-  embed: ['slideshowContainer', 'slideshowControls'],
+  embed: ['slideshowControls'],
  }
  }
- showwin = new showWindow('slideshowWindow',winparms)
+ showwin = new showWindow('slideshowContainer',winparms)
 
  var showparms = {
   wait: 3000,
 
  var showparms = {
   wait: 3000,
index 0b19b6bd4b3df1a4560fe7ae049f859aeedb8dbf..2de9fee5b7b8b8770bfd6d2c606567ddadf47e5d 100644 (file)
@@ -33,7 +33,7 @@ var slideShow = new Class({
                \r
                this.container = $(container);\r
                this.container.setStyles({\r
                \r
                this.container = $(container);\r
                this.container.setStyles({\r
-                       position: 'relative',\r
+                       /* position: 'relative', */\r
                        overflow: 'hidden'\r
                });\r
                if(this.options.onClick){\r
                        overflow: 'hidden'\r
                });\r
                if(this.options.onClick){\r
@@ -173,8 +173,10 @@ var slideShow = new Class({
                if (vfactor < factor) { factor = vfactor; }\r
                if (hfactor < factor) { factor = hfactor; }\r
                factor *= .95;\r
                if (vfactor < factor) { factor = vfactor; }\r
                if (hfactor < factor) { factor = hfactor; }\r
                factor *= .95;\r
-               height = Math.round(height * factor);\r
-               width = Math.round(width * factor);\r
+               if (factor < 1) {\r
+                       height = Math.round(height * factor);\r
+                       width = Math.round(width * factor);\r
+               }\r
                var topoff = (this.height - height)/2;\r
                var leftoff = (this.width - width)/2;\r
                /* alert('dim: '+width+'x'+height+'+'+leftoff+'+'+topoff); */\r
                var topoff = (this.height - height)/2;\r
                var leftoff = (this.width - width)/2;\r
                /* alert('dim: '+width+'x'+height+'+'+leftoff+'+'+topoff); */\r