Line 847: | Line 847: | ||
HTit = "SPONSORS"; | HTit = "SPONSORS"; | ||
break; | break; | ||
− | + | default: | |
HTit = "Sudazima"; | HTit = "Sudazima"; | ||
break; | break; | ||
Line 987: | Line 987: | ||
$( document ).ready(function() { $("body").scrollspy({target: "#myScrollspy", offset:100}); }); | $( document ).ready(function() { $("body").scrollspy({target: "#myScrollspy", offset:100}); }); | ||
// Add smooth scrolling on all links inside the navbar | // Add smooth scrolling on all links inside the navbar | ||
− | $('body'). | + | |
− | + | var jump=function(e) | |
− | + | { | |
− | + | if (e){ | |
− | + | e.preventDefault(); | |
− | $('html, body'). | + | var target = $(this).attr("href"); |
+ | }else{ | ||
+ | var target = location.hash; | ||
+ | } | ||
+ | |||
+ | $('html,body').animate( | ||
+ | { | ||
+ | scrollTop: $(target).offset().top | ||
+ | },2000,function() | ||
+ | { | ||
+ | location.hash = target; | ||
+ | }); | ||
+ | |||
+ | } | ||
+ | |||
+ | $('html, body').hide(); | ||
+ | |||
+ | $(document).ready(function() | ||
+ | { | ||
+ | $('a[href^="#snav"]').bind("click", jump); | ||
+ | |||
+ | if (location.hash){ | ||
+ | setTimeout(function(){ | ||
+ | $('html, body').scrollTop(0).show(); | ||
+ | jump(); | ||
+ | }, 0); | ||
+ | }else{ | ||
+ | $('html, body').show(); | ||
+ | } | ||
}); | }); | ||
Revision as of 23:11, 30 October 2017