$(window).resize(function(e) { e.preventDefault(); fixLayout(); fixNav(e); change = 0; }); $(window).bind('orientationchange', function(e) { e.preventDefault(); fixLayout(); fixNav(e); change = 0; }); function fixNav (e) { var offset = ($(window).height() - 120) - $(window).scrollTop(); if (offset>0 && change==1) { $("nav").css("position", "absolute") .css("top", ($(window).height() - 120) +"px") $("#nav-arrow").hide(); change = 0; } if (offset<=0 && change==0) { $("nav").css("position", "fixed") .css("top","0") $("#nav-arrow").show(); change = 1; } } var change = 0; $(window).bind("scroll", function (e) { fixNav(e); }); function fixLayout () { var winHeight = $(window).height(); var winWidth = $(window).width(); $("#filme").css("height", (winHeight-240)+"px") .css("width", winWidth+"px"); $("nav").css("top", (winHeight-120)+"px"); setTimeout(function() { $('.royalSlider').royalSlider('updateSliderSize', true); }, 100); } $(document).ready(function() { $('#nav').onePageNav(); $(".royalSlider").royalSlider({ keyboardNavEnabled: true, arrowsNavAutoHide: false, video: { autoHideBlocks: false, autoHideArrows: false }, fullscreen: { enabled: true, native: true }, autoPlay: { enabled: true, pauseOnHover: true, delay: 4000 }, controlNavigation: 'none', imageScaleMode: 'fill' }); $("#partner").find("img").each(function (index) { $(this).one("load", function() { var height = $(this).height() / $(this).width() * 80; var top = 100 - height / 2; $(this).css("height", height + "px") .css("width", "80px") .css("margin-top", top + "px") .show(); }); }); $("#team, #technikbilder").on("mouseenter","img", function () { $(this).attr("src", $(this).attr("data-color")); }).on("mouseleave", "img", function () { $(this).attr("src", $(this).attr("data-grey")); }); $("#technik ol:nth-child(2n+1)").css("margin-right","30px"); $("#referenzen ol li:nth-child(3n+0)").css("margin-right", "0"); $("#partner ol li:nth-child(5n+0)").css("margin-right", "0"); $("#kontakt ol:nth-child(2n+1)").css("margin-right", "30px"); $("#referenzen table li:nth-child(2n+1)").css("font-size","17px") .css("padding-top","25px") .css("line-height","22px") .css("color", "#474747"); fixLayout(); });