Team:NCTU Formosa/source/head
From 2013.igem.org
(Difference between revisions)
Line 98: | Line 98: | ||
}; | }; | ||
$('#toc').followTo(431); | $('#toc').followTo(431); | ||
+ | var $links=$('.#toc a'); | ||
+ | $links.each(function(){ | ||
+ | var href=$(this).attr('href'); | ||
+ | /* find corresponding anchor */ | ||
+ | var matchAnchor= $('[id="'+href+'"]'); | ||
+ | /* remove all special chars */ | ||
+ | href=href.replace(/\W/g,'dot'); | ||
+ | /* replace link href*/ | ||
+ | $(this).attr('href', '#'+href); | ||
+ | |||
+ | /* replace anchor id*/ | ||
+ | matchAnchor.attr('id', href); | ||
+ | |||
+ | }); | ||
}); | }); | ||
</script> | </script> |
Revision as of 17:19, 31 August 2013