1 line
2.2 KiB
JavaScript
1 line
2.2 KiB
JavaScript
var $htmlOnSwitch="";var $htmlOffSwitch="";jQuery(document).ready(function(e){e("div").removeClass("no-js");e(document).on("focusin",function(){var k=5;var h=document.getElementById("nav").getElementsByTagName("a");for(var j=0;j<h.length;j++){h[j].onfocus=function(){var l=this;for(var i=0;i<k*2;i++){l=l.parentNode;if(l.nodeName=="UL"||l.nodeName=="SPAN"){continue}if(l.nodeName!="LI"){break}l.className+=" hover"}};h[j].onblur=function(){var l=this;for(var i=0;i<k*2;i++){l=l.parentNode;if(l.nodeName=="UL"||l.nodeName=="SPAN"){continue}if(l.nodeName!="LI"){break}l.className=l.className.replace(/(?:^|\s)hover(?!\S)/,"")}}}});var f={width:"100%"};var c={width:"0"};var b={width:"705px"};var a={width:"1024px"};var g={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(h){e(".switchon").toggle();e(".switchoff").toggle();e(".content-aside .skin").toggle();e(".content-primary").css(f);e(".content-aside").css(c);h.preventDefault()})};e.OnClickOnSwitchOn=function(){e(".switchon a").click(function(h){e(".switchon").toggle();e(".switchoff").toggle();e(".content-aside .skin").toggle();curwidth=e(window).width();if(curwidth>1350){e(".content-primary").css(a)}else{e(".content-primary").css(b)}e(".content-aside").css(g);h.preventDefault()})};var d=e(window).width();e.SetOnSwitch();e.SetOffSwitch();e(".switchon").toggle();e.OnClickOnSwitchOff();e.OnClickOnSwitchOn();e(window).scroll(function(){if((e(window).scrollTop()>184)&&(d>800)){e("body").addClass("nav-fixed")}if((e(window).scrollTop()<=184)&&(d>800)){e("body").removeClass("nav-fixed")}});e(window).resize(function(){d=e(window).width();if((e(window).scrollTop()>184)&&(d>800)){e("body").addClass("nav-fixed")}if((e(window).scrollTop()<=184)&&(d>800)){e("body").removeClass("nav-fixed")}});e("#nav-select").change(function(){window.location.href=this.value})});jQuery(document).ready(function(a){a(".accordion h2:gt(0)").addClass("closed");a(".accordion div:gt(0)").hide();a(".accordion h2").click(function(){a(this).next("div").slideToggle("slow");a(this).toggleClass("closed")})}); |