Team:NCTU Formosa/source/header-notebook

From 2014.igem.org

(Difference between revisions)
Line 120: Line 120:
function initMenu() {
function initMenu() {
var block = $(".calendar-day");
var block = $(".calendar-day");
-
var index, indexi;
+
var index;
block.hover(function(){window.status = $(this)}, function(){window.status = ""});
block.hover(function(){window.status = $(this)}, function(){window.status = ""});
$('.note').hide();
$('.note').hide();
Line 126: Line 126:
block.click(
block.click(
function() {
function() {
-
index = block.index(this)+1;
+
// index = block.index(this)+1;
-
indexi = block.closest('.calendar').find('.calendar-day:nth-child(1)').index(this);
+
index = $(this).closest('.calendar').find('.calendar-day').index(this);
-
alert(index+" "+indexi);
+
-
index-= indexi;
+
$(this).closest('.cal-wrapper').find('.note:nth-child('+index+')').slideToggle('fast');
$(this).closest('.cal-wrapper').find('.note:nth-child('+index+')').slideToggle('fast');
}
}

Revision as of 18:49, 5 October 2014