function go(step){ if(typeof images != 'undefined'){ if(typeof images[(page+step)*4] != 'undefined'){ $('#galleryWrapper > .nav#prev').css('z-index','-1').animate({left: '20px'},"normal",function(){$(this).css('z-index','-1')}); $('#galleryWrapper > .nav#next').css('z-index','-1').animate({right: '20px'},"normal",function(){$(this).css('z-index','-1')}); page += step; done=0; $('#galleryWrapper > #gallery > .galleryRow > .imageWrapper > img').fadeOut("normal",function (){ $(this).css('visibility','hidden').toggle(); done++; if(done==4){ if(typeof images[(page+1)*4] != 'undefined') $('#galleryWrapper > .nav#next').animate({right: '0px'},"normal",function (){$(this).css('z-index','1')}); if(typeof images[(page-1)*4] != 'undefined') $('#galleryWrapper > .nav#prev').animate({left: '0px'},"normal",function (){$(this).css('z-index','1')}); left = images.length-page*4; //$('#galleryWrapper > #gallery .galleryRow > .imageWrapper').css('background','#33190f'); for(var i=0; i #gallery > .galleryRow:nth-child('+Math.floor(i/2+1)+') > .imageWrapper:nth-child('+(i%2+1)+') > img').load(function() { $(this).css('margin-left',(200-$(this).attr('width'))/2+'px').css('margin-top',(200-$(this).attr('height'))/2+'px').css('visibility','visible').toggle(); $(this).fadeIn(); }).attr('src','images/schilderijen/thumbs/'+images[page*4+i][0]).parent().css('background','#33190f'); } } }); } } } function showImage(file){ if(typeof file=='undefined'||file=='') return false; for(var key in images){ if(file.indexOf(images[key][0])!=-1){ name = images[key][1]; desc = images[key][2]; file = file.replace("images/schilderijen/thumbs/","view.php?image="); break; } } $('.overlay').css('opacity','1').toggle(); $('#galleryWrapper > .nav#prev').css('z-index','-1'); $('#galleryWrapper > .nav#next').css('z-index','-1'); if(typeof overlay != 'undefined'){ $(overlay).animate({height: '-=60px'},"fast"); $(img).fadeOut("normal",function(){ $(img).css('visibility','hidden').css('display','block'); $(overlay).animate({ width: '0px', height: '0px', marginTop: '-10px', marginLeft: '-10px'},"normal",function(){ doIt() }); }); }else{ doIt(); } function doIt(){ overlay = $('

'+name+'
'+desc+'
Sluiten
').appendTo("body"); img = $(overlay).children('img'); $(overlay).fadeIn(); $(img).load(function (){ $(img).css('visibility','hidden'); $(overlay).animate({ width: $(img).attr('width')+'px', height: $(img).attr('height')+'px', marginLeft: ($(img).attr('width')<=$(window).width() ? -10-$(img).attr('width')/2 : -$(window).width()/2)+'px', marginTop: ($(img).attr('height')<=$(window).height() ? -10-$(img).attr('height')/2 : -$(window).height()/2)+'px'},"normal",function(){ $(img).css('visibility','visible').css('display','none').fadeIn(function(){ /*$('.overlay').click(doClose);$(overlay).click(doClose)*/$('.close').click(doClose) }) }).animate({height: '+=60px'},"fast"); }).attr('src',file); } function doClose(){ $('.overlay').unbind('click'); $(overlay).unbind('click'); $(overlay).animate({height: '-=60px'},"fast"); $(img).fadeOut("normal",function(){ $(img).css('visibility','hidden').css('display','block'); $(overlay).animate({ width: '0px', height: '0px', marginTop: '-10px', marginLeft: '-10px'},"normal"); $(overlay).fadeOut("normal",function (){ delete overlay; $('.overlay').toggle(); if(typeof images[(page+1)*4] != 'undefined') $('#galleryWrapper > .nav#next').css('z-index','1'); if(typeof images[(page-1)*4] != 'undefined') $('#galleryWrapper > .nav#prev').css('z-index','1'); }); }); } }