Team:TU Delft/scroll calendar
From 2010.igem.org
(Difference between revisions)
Line 80: | Line 80: | ||
function setActiveMonth(mo) { | function setActiveMonth(mo) { | ||
+ | active_month = mo; | ||
var el = month_elems[mo]; | var el = month_elems[mo]; | ||
$('#calview').scrollTo(el, {duration: 500} ); | $('#calview').scrollTo(el, {duration: 500} ); | ||
Line 95: | Line 96: | ||
}); | }); | ||
$(".prevmonth_btn").click(function() { | $(".prevmonth_btn").click(function() { | ||
- | + | if (--active_month < 0) | |
+ | active_month = month_elems.length - 1; | ||
+ | setActiveMonth( active_month ); | ||
}); | }); | ||
$(".nextmonth_btn").click(function() { | $(".nextmonth_btn").click(function() { | ||
- | + | setActiveMonth( (active_month + 1) % month_elems.length ); | |
}); | }); | ||
Revision as of 14:53, 15 September 2010
|
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|