/** * @preserve galleria classic theme 2011-08-01 * http://galleria.aino.se * * copyright (c) 2011, aino * licensed under the mit license. */ /*global jquery, galleria */ galleria.requires(1.25, 'this version of classic theme requires galleria 1.2.5 or later'); (function($) { galleria.addtheme({ name: 'classic', author: 'galleria', css: 'galleria.classic.css', defaults: { transition: 'slide', thumbcrop: 'height', // set this to false if you want to show the caption all the time: _toggleinfo: false }, init: function(options) { // add some elements this.addelement('info-link','info-close'); this.append({ 'info' : ['info-link','info-close'] }); // cache some stuff var info = this.$('info-link,info-close,info-text'), touch = galleria.touch, click = touch ? 'touchstart' : 'click'; // show loader & counter with opacity this.$('loader,counter').show().css('opacity', 0.4); // some stuff for non-touch browsers if (! touch ) { this.addidlestate( this.get('image-nav-left'), { left:-100 }); this.addidlestate( this.get('image-nav-right'), { right:-100 }); this.addidlestate( this.get('counter'), { opacity:0 }); } // toggle info if ( options._toggleinfo === true ) { info.bind( click, function() { info.toggle(); }); } else { info.show(); this.$('info-link, info-close').hide(); } // bind some stuff this.bind('thumbnail', function(e) { debugger; if (! touch ) { // fade thumbnails $(e.thumbtarget).css('opacity', 0.6).parent().hover(function() { $(this).not('.active').children().stop().fadeto(100, 1); }, function() { $(this).not('.active').children().stop().fadeto(400, 0.6); }); if ( e.index === this.getindex() ) { $(e.thumbtarget).css('opacity',1); } } else { $(e.thumbtarget).css('opacity', this.getindex() ? 1 : 0.6); } }); this.bind('loadstart', function(e) { if (!e.cached) { this.$('loader').show().fadeto(200, 0.4); } this.$('info').toggle( this.hasinfo() ); $(e.thumbtarget).css('opacity',1).parent().siblings().children().css('opacity', 0.6); }); this.bind('loadfinish', function(e) { this.$('loader').fadeout(200); }); } }); }(jquery));