Team:NCTU Formosa/source/head

From 2013.igem.org

(Difference between revisions)
Line 23: Line 23:
         adjustStyle($(this).width());
         adjustStyle($(this).width());
     });
     });
-
  /*$('a[href*=#]').bind('click', function(e) {
 
-
e.preventDefault();
 
-
var target = $(this).attr("href");
 
-
 
-
$('html, body').stop().animate({ scrollTop: $(target).offset().top }, 2000, function() {
 
-
    location.hash = target;
 
-
});
 
-
 
-
return false;
 
-
  });*/
 
-
// Cache selectors
 
var lastId,
var lastId,
     topMenu = $("#toc"),
     topMenu = $("#toc"),
Line 46: Line 35:
     noScrollAction = false;
     noScrollAction = false;
-
// Bind click handler to menu items
 
-
// so we can get a fancy scroll animation
 
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 id = cur && cur.length ? cur[0].id : "";
+
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