|
|
Line 1,021: |
Line 1,021: |
| $('html, body').hide(); | | $('html, body').hide(); |
| | | |
− | window.onload = function() {
| + | $(document).ready(function() { |
| $('a[href^="#snav"]').bind("click", jump); | | $('a[href^="#snav"]').bind("click", jump); |
| | | |
Line 1,034: |
Line 1,034: |
| $("body").scrollspy({target: "#myScrollspy", offset:100}); | | $("body").scrollspy({target: "#myScrollspy", offset:100}); |
| } | | } |
− | }; | + | )}; |
| | | |
| var animateScroll = function(target, offset) { | | var animateScroll = function(target, offset) { |
Line 1,045: |
Line 1,045: |
| } | | } |
| | | |
− | /*
| |
− | // Add smooth scrolling on all links inside the navbar
| |
− | var animateScroll = function(target, offset) {
| |
− | var is = $(document).scrollTop();
| |
− | var must = parseInt($(target).offset().top) + offset;
| |
− | if (is < must) {
| |
− | $(document).scrollTop(is+(must/200));
| |
− | setTimeout(function() {animateScroll(target);}, 10);
| |
− | } else {
| |
− | location.hash = target;
| |
− | }
| |
− | }
| |
− |
| |
− | var jump = function(e)
| |
− | {
| |
− | if (e){
| |
− | e.preventDefault();
| |
− | var target = $(this).attr("href");
| |
− | }else{
| |
− | var target = location.hash;
| |
− | }
| |
− |
| |
− | if (typeof $(target).offset() == 'undefined') {
| |
− | return;
| |
− | }
| |
− |
| |
− | animateScroll(target, -90);
| |
− | }
| |
− |
| |
− | $('html, body').hide();
| |
− |
| |
− | $(document).ready(function()
| |
− | {
| |
− | $('a[href^="#snav"]').bind("click", jump);
| |
− |
| |
− | if (location.hash){
| |
− | setTimeout(function(){
| |
− | $('html, body').show();
| |
− | $(document).scrollTop(0);
| |
− | //$("body").scrollspy({target: "#myScrollspy", offset:100});
| |
− | jump();
| |
− | }, 10);
| |
− | }else{
| |
− | $('html, body').show();
| |
− | //$("body").scrollspy({target: "#myScrollspy", offset:100});
| |
− | }
| |
− | });*/
| |
| </script> | | </script> |
| | | |
| </html> | | </html> |