Added page layout, fixed page list, updated style
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
Makes
|
||||
*/
|
||||
|
||||
document.addEventListener("DOMContentLoaded", function(event) {
|
||||
var img = document.getElementById('main-background');
|
||||
|
||||
if(isLoaded(img)) {
|
||||
var width = img.clientWidth;
|
||||
var height = img.clientHeight;
|
||||
|
||||
if(width > (height * 1.50)) {
|
||||
img.className += ' landscape';
|
||||
}
|
||||
} else {
|
||||
img.onload = function () {
|
||||
var width = img.clientWidth;
|
||||
var height = img.clientHeight;
|
||||
|
||||
if(width > (height * 1.50)) {
|
||||
img.className += ' landscape';
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function isLoaded(img) {
|
||||
return img.complete && typeof(img.naturalHeight) !== 'undefined' && img.naturalHeight !== 0;
|
||||
}
|
||||
Reference in New Issue
Block a user