This repository has been archived by the owner on Nov 19, 2023. It is now read-only.
forked from korbinian/Piratenkleider
/
layout.min.js
1 lines (1 loc) · 2.44 KB
/
layout.min.js
1
var $htmlOnSwitch="";var $htmlOffSwitch="";jQuery(document).ready(function(e){e("div").removeClass("no-js");e(document).on("focusin",function(){var e=5;var t=document.getElementById("nav").getElementsByTagName("a");for(var n=0;n<t.length;n++){t[n].onfocus=function(){var t=this;for(var n=0;n<e*2;n++){t=t.parentNode;if(t.nodeName=="UL"||t.nodeName=="SPAN")continue;if(t.nodeName!="LI")break;t.className+=" hover"}};t[n].onblur=function(){var t=this;for(var n=0;n<e*2;n++){t=t.parentNode;if(t.nodeName=="UL"||t.nodeName=="SPAN")continue;if(t.nodeName!="LI")break;t.className=t.className.replace(/(?:^|\s)hover(?!\S)/,"")}}}});var t={width:"100%"};var n={width:"0"};var r={width:"705px"};var i={width:"1024px"};var s={width:"319px"};e.SetOnSwitch=function(){e(".content-primary").prepend($htmlOnSwitch)};e.SetOffSwitch=function(){e(".content-primary").prepend($htmlOffSwitch)};e.OnClickOnSwitchOff=function(){e(".switchoff a").click(function(r){e(".switchon").toggle();e(".switchoff").toggle();e(".content-aside .skin").toggle();e(".content-primary").css(t);e(".content-aside").css(n);r.preventDefault()})};e.OnClickOnSwitchOn=function(){e(".switchon a").click(function(t){e(".switchon").toggle();e(".switchoff").toggle();e(".content-aside .skin").toggle();curwidth=e(window).width();if(curwidth>1350){e(".content-primary").css(i)}else{e(".content-primary").css(r)}e(".content-aside").css(s);t.preventDefault()})};var o=e(window).width();e.SetOnSwitch();e.SetOffSwitch();e(".switchon").toggle();e.OnClickOnSwitchOff();e.OnClickOnSwitchOn();e(window).scroll(function(){if(e(window).scrollTop()>184&&o>800){e("body").addClass("nav-fixed")}if(e(window).scrollTop()<=184&&o>800){e("body").removeClass("nav-fixed")}});e("#nav-select").change(function(){window.location.href=this.value})});(function(){var e={skipClass:"p3-skip",init:function(){var t=navigator.userAgent.toLowerCase();var n=t.indexOf("webkit")>-1;var r=t.indexOf("msie")>-1;if(n||r){var i=document.body,s=e.click;if(i.addEventListener){i.addEventListener("click",s,false)}else if(i.attachEvent){i.attachEvent("onclick",s)}}},trim:function(e){return e.replace(/^\s\s*/,"").replace(/\s\s*$/,"")},click:function(t){t=t||window.event;var n=t.target||t.srcElement;var r=n.className.split(" ");for(var i=0;i<r.length;i++){var s=e.trim(r[i]);if(s===e.skipClass){e.focus(n);break}}},focus:function(e){if(e.href){var t=e.href,n=t.substr(t.indexOf("#")+1),r=document.getElementById(n);if(r){r.setAttribute("tabindex","-1");r.focus()}}}};e.init()})()