с ресайзом
function getScreenWidth() {
return window.innerWidth
? window.innerWidth
: (document.documentElement.clientWidth
? document.documentElement.clientWidth
: document.body.offsetWidth);
}
function prepareElement(id, width) {
var __element = document.getElementById(id);
if(width >= 900) {
__element.style = 'display: block';
}
else {
__element.style = 'display: none';
}
}
window.onload = function() {
prepareElement('container', getScreenWidth());
window.onresize = function() {
prepareElement('container', getScreenWidth());
}
}