Hide Me Toolbar
Hide Me Toolbar
by hamix
HTML
<div id="main-content" >
<img src="http://oi45.tinypic.com/2u8hyjo.jpg"/>
<img src="http://oi47.tinypic.com/250teeh.jpg"/>
</div>
<span class="size"></span>
CSS
.width50{
width: 50% !important;
}
.width100{
width: 100% !important;
}
JavaScript
$(window).on('resize', function(){
var box = $(this);
var width = box.width();
var height = box.height();
if ( width < 320) {
$("img").each(function(){
if($(this).width<400)
$(this).addClass("width50");
else
$(this).addClass("width100");
});
} else {
$("img").removeClass("width50 width100");
}
$('.size').html(width+'x'+height);
}).trigger('resize');