var pause=8500; var globalstop=0; var curimg=0; var photos=new Array(); var cache = []; var i=0; var baseurl="http://judo.is/wp-content/themes/judo"; photos[0]=baseurl + "/images/collage/photo0.png"; photos[1]=baseurl + "/images/collage/photo1.png"; photos[2]=baseurl + "/images/collage/photo2.png"; photos[3]=baseurl + "/images/collage/photo3.png"; photos[4]=baseurl + "/images/collage/photo4.png"; photos[5]=baseurl + "/images/collage/photo5.png"; photos[6]=baseurl + "/images/collage/photo6.png"; photos[7]=baseurl + "/images/collage/photo7.png"; photos[8]=baseurl + "/images/collage/photo8.png"; photos[9]=baseurl + "/images/collage/photo9.png"; photos[10]=baseurl + "/images/collage/photo10.png"; $(document).ready(function() { /* Preload collage images */ for (i=0; i < photos.length; i++) { var cacheImage = document.createElement('img'); cacheImage.src = photos[i]; cache.push(cacheImage); } function advImg() { if (globalstop == 1) { return; } if (curimg == (photos.length - 1)) { /* roll over */ curimg=0; } else { curimg += 1; } $('#collage').fadeOut(1000, function () { $('#collage').css("background-image", "url(" + photos[curimg] + ")"); $('#collage-link').attr("href", baseurl + "/images/collage/orig/photo" + curimg + ".jpg"); $('#collage').fadeIn(1000); }); } setInterval(advImg, pause); $('#collage').mouseenter(function() { globalstop=1; /* stop the slideshow */ $('#collage-sub').fadeIn("fast"); }); $('#collage').mouseleave(function() { globalstop=0; /* restart slideshow */ $('#collage-sub').fadeOut("slow"); }); $('#google-calendar-small').mouseenter(function() { $('.google-calendar-sub').fadeIn("fast"); }); $('#google-calendar-small').mouseleave(function() { $('.google-calendar-sub').fadeOut("fast"); }); $('.gallery-item').each(function() { $(this).prepend(''); }); $('.gallery-item').mouseenter(function() { $(this).children('.img-magnifier').fadeIn("fast"); }); $('.gallery-item').mouseleave(function() { $(this).children('.img-magnifier').fadeOut("fast"); }); /* gallery images */ $('.gallery a:has(img)').colorbox({ opacity: 0.8, height:"80%" }); /* stand-alone images */ $('.entry-content > p > a[href$=png],[href$=jpg],[href$=jpeg],[href$=gif]').colorbox({ opacity: 0.8, height:"80%" }); /* stuff in colorbox class */ $(".colorbox").colorbox({ opacity: 0.8 }); /* hack that makes ja.is links in the link widget appear in a colorbox with iframe */ $(".widget_links > ul > li > a[href*=ja.is]").colorbox({width:"80%", height:"80%", iframe:true, opacity: 0.8}); $("#google-calendar-sub-link").colorbox({width:"80%", height:"80%", iframe:true, opacity: 0.8}); $("a[href*=spreadsheets.google.com]").each(function() { $(this).wrap(''); $(this).before(''); $(this).colorbox({width: "700px", height: "80%", iframe:true, opacity:0.8}); }); /* Dirty lazy hacks */ $('.widget_meta > ul').append('
  • Tölvupóstur
  • '); $('.widget_meta > ul').append('
  • Felix
  • '); $('.menu > ul > li > a').attr('title', ''); $('.menu > ul > li.current_page_item').children('ul.children').slideDown('slow'); $('.menu > ul > li > ul > li.current_page_item').parent().css('display', 'block'); /* Equalize the height of .columns */ var tallest=0; $('.columns').each(function(){ if (tallest < $(this).outerHeight(true)) { tallest=$(this).outerHeight(true); } }); $('.columns').height(tallest); });