Difference between revisions of "Team:Tuebingen/Notebook"

Line 5: Line 5:
 
function init() {
 
function init() {
  
document.getElementById('arrowRight').style.display = 'block';
 
document.getElementById('arrowLeft').style.display = 'block';
 
  
 
diashow(0);
 
 
var cal = document.getElementById('calendar');
 
var cal = document.getElementById('calendar');
 
cal.style.cssText='width:630;height:200;';
 
cal.style.cssText='width:630;height:200;';
Line 26: Line 22:
 
var week = document.createElement('div');
 
var week = document.createElement('div');
 
week.style.cssText = 'width:21vw;height:3vw;cursor:pointer;';
 
week.style.cssText = 'width:21vw;height:3vw;cursor:pointer;';
week.onmouseover = function() {this.style.backgroundColor = 'rgba(0,0,0,0.2)';};
+
week.onmouseover = function() {if (this.id != 'calWeek'+currentDia) this.style.backgroundColor = 'rgba(0,0,0,0.2)';};
week.onmouseout = function() {this.style.backgroundColor = 'transparent';};
+
week.onmouseout = function() {if (this.id != 'calWeek'+currentDia) this.style.backgroundColor = 'transparent';};
 +
week.id = 'calWeek'+(w*4+i);
 
for (var q=0;q<7;q++) {
 
for (var q=0;q<7;q++) {
 
var date = document.createElement('div');
 
var date = document.createElement('div');
Line 47: Line 44:
 
}
 
}
 
 
+
dias = new Array(12);
 +
currentDia = 0;
 +
function diashow(shift) {
 +
nextDia = currentDia+shift;
 +
if (nextDia < 0) nextDia = dias.length-1;
 +
else if (nextDia >= dias.length) nextDia = 0;
 +
document.getElementById('dia'+currentDia).style.opacity = '0';
 +
document.getElementById('dia'+currentDia).style.display = 'none';
 +
document.getElementById('dia'+currentDia).style.zIndex = '0';
 +
document.getElementById('dia'+nextDia).style.opacity = '1';
 +
document.getElementById('dia'+nextDia).style.display = 'block';
 +
document.getElementById('dia'+nextDia).style.zIndex = '1';
 +
document.getElementById('calWeek'+currentDia).style.backgroundColor = 'transparent';
 +
document.getElementById('calWeek'+nextDia).style.backgroundColor = 'rgba(0,255,0,0.2)';
 +
currentDia = nextDia;
 +
}
 +
 +
document.getElementById('arrowRight').style.display = 'block';
 +
document.getElementById('arrowLeft').style.display = 'block';
 +
diashow(0);
 
}
 
}
 
</script>
 
</script>
 
<body onload="init();">
 
<body onload="init();">
 
<div style="width:100%;text-align:center;"><div id="calendar"></div></div>
 
<div style="width:100%;text-align:center;"><div id="calendar"></div></div>
 +
 +
 +
 +
 +
<!-- LABBOOK WEEKS -->
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 
</body>
 
</body>

Revision as of 10:14, 18 September 2015

<
>