jQuery filter affects width?
HTML
<div class='container'>
<div class='head'>Some header</div>
<div class='content'>
<div class='longcontent'>Some long content</div>
</div>
CSS
.container { height:500px; color:white; }
.head { background:red; height:50px; }
.longcontent { background:orange; height:1000px; }
JavaScript
$(".container").css({
overflow: "auto"
});
// comment this line (which does nothing and see the what the width of the header does in chrome)
// it should do basically nothing - it is not assigned to any variable, nor is any action called
// - yet it makes the header shrink by the scrollbar width...
$(".container").filter(":visible");
// set overflow to hidden
$(".container").css({
overflow: "hidden"
});
$(".content").css({
overflow: "auto",
height: "450px"
});