Team:NCTU Formosa/source/head
From 2013.igem.org
(Difference between revisions)
Line 23: | Line 23: | ||
adjustStyle($(this).width()); | adjustStyle($(this).width()); | ||
}); | }); | ||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
var lastId, | var lastId, | ||
topMenu = $("#toc"), | topMenu = $("#toc"), | ||
Line 46: | Line 35: | ||
noScrollAction = false; | noScrollAction = false; | ||
- | |||
- | |||
menuItems.click(function(e){ | menuItems.click(function(e){ | ||
var href = $(this).attr("href"), | var href = $(this).attr("href"), | ||
Line 79: | Line 66: | ||
// Get the id of the current element | // Get the id of the current element | ||
cur = cur[cur.length-1]; | cur = cur[cur.length-1]; | ||
- | + | var chk=0; | |
+ | if(cur) if(cur.length) chk=1; | ||
+ | var id = chk ? cur[0].id : ""; | ||
if (lastId !== id) { | if (lastId !== id) { |
Revision as of 19:53, 29 August 2013