jQuery.fn.center = function () { this.css("position","fixed"); this.css("top", Math.max(0, (($(window).height() - $(this).outerHeight()) / 2) + $(window).scrollTop()) + "px"); this.css("left", Math.max(0, (($(window).width() - $(this).outerWidth()) / 2) + $(window).scrollLeft()) + "px"); return this; } jQuery.fn.extend({ scrollToPoint: function (scrollSpeed) { var x = jQuery(this).offset().top - 100; jQuery('html,body').animate({scrollTop: x}, scrollSpeed,'easeInOutCubic'); }}); function slideSwitch(switchSpeed) { var $active = jQuery('#slideshow img.active'); if ( $active.length == 0 ) $active = jQuery('#slideshow img:last'); var $next = $active.next('img').length ? $active.next('img') : jQuery('#slideshow img:first'); $active.addClass('last-active').fadeOut(switchSpeed,'easeInOutCubic'); $next.addClass('active').fadeIn(switchSpeed); $active.removeClass('active last-active'); } function go_timer() { slideSwitch(1000); setInterval ( "slideSwitch(1000)", 10000 ); } var jetzt_timestamp = '28' var sek_diff = 0; if (jetzt_timestamp <= 60) { sek_diff = 60 - jetzt_timestamp; } if (jetzt_timestamp < 50) { sek_diff = 50 - jetzt_timestamp; } if (jetzt_timestamp < 40) { sek_diff = 40 - jetzt_timestamp; } if (jetzt_timestamp < 30) { sek_diff = 30 - jetzt_timestamp; } if (jetzt_timestamp < 20) { sek_diff = 20 - jetzt_timestamp; } if (jetzt_timestamp < 10) { sek_diff = 10 - jetzt_timestamp; } sek_diff = sek_diff * 1000; setTimeout ( "slideSwitch(1000), go_timer()", sek_diff ); $(document).ready(function() { $('.jquery_gallery a').lightBox(); $('a.lightbox').lightBox(); $('#infoboxcontent').draggable(); $('#infoboxcontent').center(); /* var top = $('#navi').offset().top - parseFloat($('#navi').css('marginTop').replace(/auto/, 0)); $(window).scroll(function (event) { // what the y position of the scroll is var y = $(this).scrollTop(); var left = $(this).scrollLeft(); // whether that's below the form if (y>=top && left<1) { // if so, ad the fixed class $('#navi').fadeIn(500),$(function() { $('#navi').css("position","fixed"); $('#navi').css("top","10px"); }); } else { // otherwise remove it if (left>0) { if (y>=top) { $(function() { $('#navi').stop().fadeOut(500); }); } } else { $('#navi').fadeIn(500),$(function() { $('#navi').css("position","relative"); $('#navi').css("top","0px"); }); } } }); */ }); $(window).load(function () { $('#overlay').fadeOut(0),$(function() { $('#fadeInContent').fadeIn(500,'easeInOutCubic'); }); });