I've finished designing a web site and now I'd love to make it responsive, I just need to make it responsive for PCs as much can't be done on mobiles using the site.
I'm just wondering how the iCloud guys do that, when you re-size the window, all the elements positioning and re-sizing by itself nicely, are they using pure CSS or mixture of both CSS and JS? iCloud
I found many tutorials but still couldn't figure out why it won't work for me.
http://unstoppablerobotninja.com/demos/resize/
my example html structure:
<div id="place">
<div id="wrap">
<div id="1"><img src="">this div needs to be responsive</div>
<div id="2"><img src="">this too</div>
<div id="3"><img src="">and this</div>
<div id="4"><img src="">also this</div>
</div>
</div>
current CSS styles:
#place{
position: relative;
width:3065px;
height:560px;
margin:0px;
}
#wrap,
{
width:975px;
height:480px;
position: absolute;
top:80px;
}
#1{
width:215px;
height:103px;
position: absolute;
left:0px;
top:0px;
background-color:#409da5;
}
#1 img,
{
width: 100%;
height: 100%;
}
I can use window.resize to detect window resize and then change the size of elements using jQuery.
$(window).resize(function() {
var nh = $("#1")width() / ratio;
$("#1").css('height', nh + 'px');
var nw = $("#1").height() * ratio;
$("#1").css('width', nw + 'px');
});
but are there any other ways to do this?