/* KONFIGURATION */ var fadeTime = 2000 /* Überblend-Zeit in ms */, showTime = 5000 /* Zeit, die ein Bild angezeigt wird in ms */, scrollTime = 1000 /* Zeit für die Scrollanimation beim Klick auf den "nach oben"-Pfeil in ms */; /* ENDE Konfiguration */ /* ======================================================================== */ var pics = [], curPicIdx = -1; function slideshow() { if (curPicIdx < pics.length - 1) curPicIdx ++; else curPicIdx = 0; var img = new Image() img.onload = function () { //if (img.width < 600 || img.height < 400) return; jQuery('.gallery:first-child').css('background', '#bf2d17 url(' + pics[curPicIdx] + ') no-repeat center center').fadeIn(fadeTime); jQuery("#image").fadeOut(fadeTime, function () { jQuery('#image').css('background', 'transparent none'); jQuery('#image').show(function () { jQuery('#image').css('background', '#bf2d17 url(' + pics[curPicIdx] + ') no-repeat center center'); }); }); }; img.src = pics[curPicIdx]; setTimeout(slideshow, showTime); } jQuery(function () { // Diverses jQuery('a').each(function () { if (jQuery(this).text().match(/weiterlesen/i)) jQuery(this).addClass('link-continue'); }); jQuery('.tooltip').live('mouseover', function () { jQuery(this).fadeOut(); }); jQuery('[title]').tooltip({ effect: 'fade', position: 'top center', predelay: 500 }); jQuery('.gallery a').each(function () { pics.push(this.href); }); jQuery('img.ajax-loader').attr('src', '/wp-content/themes/adventureworld-forbach/images/ajax-loader.gif'); // Pfeil nach oben / nach unten abhängig von Scrollposition var goto_direction, goto_direction_previous; jQuery('#topbtn').click(function() { jQuery.scrollTo(goto_direction_previous == 'top' ? 0 : jQuery(document).height(), scrollTime); return false; }); jQuery(window).scroll(function () { if (jQuery(document).scrollTop() < jQuery(window).height() / 2) goto_direction = 'btm'; else goto_direction = 'top'; if (goto_direction != goto_direction_previous) { goto_direction_previous = goto_direction; if (goto_direction == 'top') { jQuery('#topbtn').html('▲').css('background-image', 'url(/wp-content/themes/adventureworld-forbach/images/topbtn.png)'); } else { jQuery('#topbtn').html('▼').css('background-image', 'url(/wp-content/themes/adventureworld-forbach/images/btmbtn.png)'); } } }); jQuery(window).scroll(); // Anchor-Scroll jQuery('a[href^=#]').filter(function() { return jQuery(this).attr('id') != 'topbtn' && jQuery(this).attr('href') != '#' && jQuery(jQuery(this).attr('href')).length; }).click(function () { jQuery.scrollTo(jQuery(jQuery(this).attr('href')).parent().position().top + parseInt(jQuery('#wrapper').css('padding-top')), scrollTime); return false; }); }); jQuery(window).load(function () { if (pics.length) { jQuery('.gallery:first-child').html('
'); slideshow(); } });