I have a single page website and am trying to set the minimum height and width using CSS. But jQuery seems to ignore my minimum sizes.
I am resizing my window using this:
$(window).resize(function () {
resizePanel();
});
function resizePanel() {
width = $(window).width();
height = $(window).height();
mask_width = width * $('.item').length;
$('#wrapper, .item').css({width: width, height: height});
$('#mask').css({width: mask_width, height: height});
}
The html looks like this.
</head>
<body>
<div id="wrapper">
<div id="mask">
<div id="item1" class="item">
</div>
<div id="item2" class="item">
</div>
<div id="item3" class="item">
</div>
<div id="item4" class="item">
</div>
</div>
</div>
</body>
</html>
each of these divs fits off the screen using this CSS.
body, html {
height:100%;
width:100%;
margin:0;padding:0;
overflow:hidden;
}
#wrapper {
width:100%;
height:100%;
position:absolute;
top:0;left:0;
background-color:#ccc;
overflow:hidden;
}
#mask {
width:400%;
height:100%;
background-color:#eee;
}
.item {
width:25%;
height:100%;
float:left;
background-color:#ddd;
min-height:700px;
min-width: 700px;
}
Any ideas would be very helpful.
Aaron source
share