Difference between revisions of "Team:Tuebingen/Notebook"

Line 1: Line 1:
 
{{Tuebingen}}
 
{{Tuebingen}}
<html>
 
 
<script lang="text/javascript">
 
<script lang="text/javascript">
  
function init() {
+
var oldFunc = document.body.onload;
 +
document.body.onload = function () {oldFunc();initCal();};
 +
 
 +
function initCal() {
 
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 39: Line 41:
 
}
 
}
  
</script>
 
  
<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>
</body>
 

Revision as of 02:38, 18 September 2015

<
>
<script lang="text/javascript">

var oldFunc = document.body.onload; document.body.onload = function () {oldFunc();initCal();};

function initCal() { var cal = document.getElementById('calendar'); cal.style.cssText='width:630;height:200;';

var count = 29; for (var w=0;w<3;w++) { var month = document.createElement('div'); month.style.cssText = 'width:21vw;height:15vw;display:inline-block;margin:5px;border:2px solid grey'; var monthTitle = document.createElement('div'); monthTitle.style.cssText = 'width:100%;height:3vw;font-size:1.8vw;line-height:1.8vw;padding:0.2vw;box-sizing:border-box;font-weight:bold;'; if (w==0) monthTitle.innerHTML = 'July'; if (w==1) monthTitle.innerHTML = 'August'; if (w==2) monthTitle.innerHTML = 'September'; month.appendChild(monthTitle); for (var i=0;i<4;i++) { var week = document.createElement('div'); week.style.cssText = 'width:21vw;height:3vw;cursor:pointer;'; week.onmouseover = function() {this.style.backgroundColor = 'rgba(0,0,0,0.2)';}; week.onmouseout = function() {this.style.backgroundColor = 'transparent';}; for (var q=0;q<7;q++) { var date = document.createElement('div'); date.style.cssText = 'width:3vw;height:3vw;float:left;border:1px solid grey;overflow:hidden;color:grey;font-size:16px;text-align:center;box-sizing:border-box;'; date.innerHTML = count; if (w == 0) if (count == 30) count = 0; if (w > 0) if (count == 31) count = 0; count++; week.appendChild(date); } month.appendChild(week); } cal.appendChild(month); }


}