2 * Galleria Fullscreen Theme
3 * http://galleria.aino.se
5 * Copyright (c) 2010, Aino
6 * Licensed under the MIT license.
15 css: 'galleria.fullscreen.css',
21 init: function(options) {
23 this.addElement('thumbnails-tab');
24 this.appendChild('thumbnails-container','thumbnails-tab');
26 var tab = this.$('thumbnails-tab');
27 var loader = this.$('loader');
28 var thumbs = this.$('thumbnails-container');
29 var list = this.$('thumbnails-list');
30 var infotext = this.$('info-text');
31 var info = this.$('info');
37 this.addElement('iefix');
38 this.appendChild('container','iefix');
39 this.setStyle(this.get('iefix'), {
42 backgroundColor: '#000',
47 if (options.thumbnails === false) {
51 var fixCaption = this.proxy(function(img) {
52 if (!(img || img.width)) {
55 var w = Math.min(img.width, $(window).width());
57 if (Galleria.IE && this.options.show_caption) {
58 this.$('iefix').width(info.outerWidth()).height(info.outerHeight());
62 this.bind(Galleria.RESCALE, function() {
63 POS = this.stageHeight - tab.height()-2;
64 thumbs.css('top', OPEN ? POS - list.outerHeight() + 2 : POS);
65 var img = this.getActiveImage();
71 this.bind(Galleria.LOADSTART, function(e) {
73 loader.show().fadeTo(100, 1);
75 $(e.thumbTarget).css('opacity',1).parent().siblings('.active').children().css('opacity',.5);
78 this.bind(Galleria.LOADFINISH, function(e) {
80 this.$('info,iefix').toggle(this.hasInfo());
83 this.bind(Galleria.IMAGE, function(e) {
84 fixCaption(e.imageTarget);
87 this.bind(Galleria.THUMBNAIL, function(e) {
88 $(e.thumbTarget).click(function() {
95 this.trigger(Galleria.RESCALE);
97 this.addIdleState(thumbs, { opacity:0 });
98 this.addIdleState(this.get('info'), { opacity:0 });
101 this.addIdleState(this.get('iefix'), { opacity:0 });
104 this.attachKeyboard({
119 this.$('image-nav-left, image-nav-right').css('opacity',0.01).hover(function() {
120 $(this).animate({opacity:1},100);
122 $(this).animate({opacity:0});
125 tab.click(this.proxy(function() {
126 tab.toggleClass('open', !OPEN);
129 top: POS - list.outerHeight() + 2
139 this.$('thumbnails').children().hover(function() {
140 $(this).not('.active').children().css('opacity', 1);
142 $(this).not('.active').children().fadeTo(200, .5);
143 }).children().css('opacity',.5)
145 this.enterFullscreen();