joseph-knows-best/lib/js/scripts.js

1 line
2 KiB
JavaScript
Raw Permalink Normal View History

2018-03-20 13:54:52 +01:00
window.getComputedStyle||(window.getComputedStyle=function(a){return this.el=a,this.getPropertyValue=function(b){var c=/(\-([a-z]){1})/g;return"float"==b&&(b="styleFloat"),c.test(b)&&(b=b.replace(c,function(){return arguments[2].toUpperCase()})),a.currentStyle[b]?a.currentStyle[b]:null},this}),jQuery(document).ready(function(a){var b=a(window).width();b>=768&&a(".comment img[data-gravatar]").each(function(){a(this).attr("src",a(this).attr("data-gravatar"))})}),function(a){function l(){c.setAttribute("content",f),g=!0}function m(){c.setAttribute("content",e),g=!1}function n(b){k=b.accelerationIncludingGravity,h=Math.abs(k.x),i=Math.abs(k.y),j=Math.abs(k.z),!a.orientation&&(h>7||(j>6&&i<8||j<8&&i>6)&&h>5)?g&&m():g||l()}if(/iPhone|iPad|iPod/.test(navigator.platform)&&navigator.userAgent.indexOf("AppleWebKit")>-1){var b=a.document;if(b.querySelector){var h,i,j,k,c=b.querySelector("meta[name=viewport]"),d=c&&c.getAttribute("content"),e=d+",maximum-scale=1",f=d+",maximum-scale=10",g=!0;c&&(a.addEventListener("orientationchange",l,!1),a.addEventListener("devicemotion",n,!1))}}}(this),jQuery(document).ready(function(){jQuery(".fancybox").fancybox({closeBtn:!0,beforeShow:function(){this.title=jQuery(this.element).find("img").attr("alt")},helpers:{title:{type:"inside"},buttons:{}}}),jQuery(".inhaltvz").onePageNav({currentClass:"current-menu-item",changeHash:!1,scrollSpeed:1e3,scrollThreshold:.5,filter:"",easing:"swing",begin:function(){},end:function(){},scrollChange:function(){}}),jQuery("#back-top").hide(),jQuery(function(){jQuery(window).scroll(function(){jQuery(this).scrollTop()>500?jQuery("#back-top").fadeIn():jQuery("#back-top").fadeOut()})}),jQuery(function(){jQuery(window).scroll(function(){jQuery(this).scrollTop()>200?jQuery("#nav-flyin").fadeIn():jQuery("#nav-flyin").fadeOut()})}),jQuery('a[href^="#"]').on("click",function(a){a.preventDefault();var b=this.hash,c=jQuery(b);jQuery("html, body").stop().animate({scrollTop:c.offset().top},500,function(){window.location.hash=b})})});