Team:DTU-Denmark/sysucolortest
From 2014.igem.org
(Difference between revisions)
Line 11: | Line 11: | ||
$(document).ready(function(){ | $(document).ready(function(){ | ||
- | $('.scrollable'). | + | $('.scrollable').each(function() { |
- | $('body').animate({ | + | var target = $(this).attr("href").match(/#(.)+$/); |
- | + | alert(target); | |
- | + | } | |
- | }); | + | |
+ | |||
+ | $('.scrollable').click(function() { | ||
+ | $('body').animate({ | ||
+ | scrollTop: eval($('#' + $(this).attr('target')).offset().top-30) | ||
+ | }, 800); | ||
+ | }); | ||
}); | }); | ||
Revision as of 09:33, 17 October 2014
MOVED to template_css