Template:Team:Cambridge/CAM 2012 TEMPLATE HEAD PROJECT
From 2012.igem.org
(Difference between revisions)
Pdmallaband (Talk | contribs) |
Pdmallaband (Talk | contribs) |
||
Line 89: | Line 89: | ||
$(document).ready(function() { | $(document).ready(function() { | ||
+ | if(window.location.hash) { | ||
+ | // Fragment exists | ||
+ | $('html').scrollTop($($(this).attr('href')).position().top + 150) | ||
+ | |||
+ | } else { | ||
+ | // Fragment doesn't exist | ||
+ | |||
+ | |||
+ | } | ||
var top = $('#cam_top_logos').offset().top - parseFloat($('#cam_top_logos').css('marginTop').replace(/auto/, 0)); | var top = $('#cam_top_logos').offset().top - parseFloat($('#cam_top_logos').css('marginTop').replace(/auto/, 0)); | ||
$(window).scroll(function (event) { | $(window).scroll(function (event) { |
Revision as of 13:26, 26 September 2012