Team:NCTU Formosa/source/head

From 2013.igem.org

(Difference between revisions)
Line 18: Line 18:
     }
     }
}
}
-
 
$(function() {
$(function() {
     adjustStyle($(this).width());
     adjustStyle($(this).width());
Line 24: Line 23:
         adjustStyle($(this).width());
         adjustStyle($(this).width());
     });
     });
 +
});
 +
$('a[href*=#]:not([href=#])').click(function() {
 +
    if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
 +
        || location.hostname == this.hostname) {
 +
 +
        var target = $(this.hash);
 +
        target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
 +
          if (target.length) {
 +
            $('html,body').animate({
 +
                scrollTop: target.offset().top
 +
            }, 1000);
 +
            return false;
 +
        }
 +
    }
});
});
</script>
</script>

Revision as of 05:52, 29 August 2013