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;
+
var index, indexi;
block.hover(function(){window.status = $(this)}, function(){window.status = ""});
block.hover(function(){window.status = $(this)}, function(){window.status = ""});
$('.note').hide();
$('.note').hide();
Line 127: Line 127:
function() {
function() {
index = block.index(this)+1;
index = block.index(this)+1;
-
alert(index);
+
indexi = block.closest('.calendar').find('.note:nth-child(1)').index(this);
-
$(this).closest('.card').find('.note:nth-child('+index+')').slideToggle('fast');
+
index-= indexi;
 +
$(this).closest('.cal-wrapper').find('.note:nth-child('+index+')').slideToggle('fast');
}
}
);}
);}
$(document).ready(function() {initMenu();});
$(document).ready(function() {initMenu();});
</script>
</script>

Revision as of 18:41, 5 October 2014