Skip to content

Instantly share code, notes, and snippets.

@riix
Created January 8, 2013 07:37
Show Gist options
  • Select an option

  • Save riix/4481995 to your computer and use it in GitHub Desktop.

Select an option

Save riix/4481995 to your computer and use it in GitHub Desktop.
BlocksIt 를 이용한 MediaQuerie 대체 용법
var currentWidth = 1100;
$(window).resize(function() {
var winWidth = $(window).width();
var conWidth;
if(winWidth < 660) {
conWidth = 440;
col = 2
} else if(winWidth < 880) {
conWidth = 660;
col = 3
} else if(winWidth < 1100) {
conWidth = 880;
col = 4;
} else {
conWidth = 1100;
col = 5;
}
if(conWidth != currentWidth) {
currentWidth = conWidth;
$('#container').width(conWidth);
$('#container').BlocksIt({
numOfCol: col,
offsetX: 8,
offsetY: 8
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment