Skip to content

Instantly share code, notes, and snippets.

View malte-j's full-sized avatar
❤️
🍍🍕

Malte Janßen malte-j

❤️
🍍🍕
View GitHub Profile
@malte-j
malte-j / fullscreen.js
Created October 21, 2017 15:58
Fullscreen elements using js
function calcVH () {
var vH = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
document.querySelector('body').setAttribute("style", "height:" + vH + "px;");
}
window.onload = calcVH();
window.addEventListener('onorientationchange', calcVH, true);
window.addEventListener('resize', calcVH, true);
@malte-j
malte-j / 2DArray.js
Created September 21, 2017 15:33
JS 2D Array
function Create2DArray(rows, columns) {
var arr = [];
for (var i = 0; i < rows; i++) {
var col = [];
for (var j = 0; j < columns; j++){
col[j] = 0;
}
arr[i] = col;
}
return arr;