/* gNavResponsive -------------------------------------------------------------------------- */ $(document).ready(function() { var gmenu = $('#gMenu'); var gmenubtn = $('#gMenuBtn'); $('#gMenuBtn a').click( function() { gmenu.toggleClass( "view" ); gmenubtn.toggleClass( "view" ); return false; } ); }); /* gNavMega -------------------------------------------------------------------------- */ $(document).ready(function() { $("#gMenu li").hover(function(){ $(this).addClass("focus"); $(this).children(".inBox").slideDown(); }, function() { $(this).children(".inBox").hide(); $(this).removeClass("focus"); }); }); /* alphaRO -------------------------------------------------------------------------- */ $(document).ready( function() { var alpha = 0.7; var _me = 'mouseenter'; var _ml = 'mouseleave'; var ua = navigator.userAgent; if( ua.indexOf('iPhone') > 0 || ua.indexOf('iPod') > 0 || ua.indexOf('iPad') > 0 || ua.indexOf('Android') > 0 ){ _me = 'touchstart'; _ml = 'touchend'; } $("a").on( _me, function() { $(this).css("opacity", alpha); } ).on( _ml, function() { $(this).css("opacity", 1); } ); } ); /* smoothScrolling -------------------------------------------------------------------------- */ jQuery(document).ready( function($) { var _set={ speed:700, easing:'easeInOutSine', hash:true }; var _hash,_h,_inH,_flag=true; var strUA=navigator.userAgent.toLowerCase(); var _scrTgt=$('html'); if(strUA.indexOf("safari") !=-1) _scrTgt=$('body'); $("a.pn[href^='#']").click(function() { var tgt=$(this).attr('href').substr(1); _h=Math.max(document.body.clientHeight ,document.body.scrollHeight); _h=Math.max(_h ,document.documentElement.scrollHeight); _h=Math.max(_h ,document.documentElement.clientHeight); _inH=(window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight); toPos(tgt); return false; }); if(_set.hash) { setInterval(function() { var sHash=getHash(); toPosBrowse(sHash); },200); } function toPos(gHash) { if(_flag) { _hash=gHash; _flag=false; _scrTgt.animate({scrollTop:toGetPoint()},_set.speed,_set.easing,setHash); } } function toPosBrowse(gHash) { if(_hash && _hash !==gHash && _flag) { _hash=gHash; _scrTgt.stop(true,false).scrollTop(toGetPoint()); _flag=true; } } function toGetPoint() { var result=0; if(_hash !='') { var tgt = $("#"+_hash); if(! tgt.length ) tgt = $("*[name='"+_hash+"']").eq(0); if( tgt.length ) { result = tgt.offset().top; if(result+_inH>_h) result=_h-_inH; } } return result; } function getTarget() { var tgt = $("*[name='"+_hash+"']"); if(! tgt ) { return $("#"+_hash); } } function getHash() { if (typeof window.location.hash !=='undefined') { return window.location.hash.substr(1); } else { return location.hash.substr(1); } } function setHash() { if(_set.hash) { if (typeof window.location.hash !=='undefined') { if (window.location.hash !==_hash) { window.location.hash=_hash; } } else if(location.hash !==_hash) { location.hash=_hash; } } _flag=true; } return $(this); } );