I'm attempting to have all four images displayed on a single line without wrapping to the next line. Strangely, I can't seem to achieve this even though zooming out shows it exactly as desired. How can I make this work?
My goal is to enable horizontal scrolling to view these images.
HTML
<div id="main">
<div id="scroll">
<div class="Wrapper">
<div class="scrollArea">
<img src="">
<img src="">
<img src="">
<img src="">
</div>
</div>
</div>
</div>
CSS
*{
font-size:100%;
margin: 0px;
padding: 0px;
}
body{
width: 100%;
height: 100%;
}
#main{
position: absolute;
top:100px;
bottom:100px;
left:0;
width: 100%;
background: black;
}
#scroll{
position: relative;
width: 100%;
height: 100%;
}
div.Wrapper{
position: relative;
overflow: auto;
width: 100%;
height: 100%;
}
div.scrollArea{
position: relative;
width: auto;
height: 100%;
}
.scrollArea img{
max-width: 100%;
max-height: 100%;
}
Jquery
var totalWidth = 0;
$('.scrollArea img').each(function(){
totalWidth += parseInt($(this).width(), 10);
});
$('.scrollArea').css("width", totalWidth);