Created
January 8, 2013 07:37
-
-
Save riix/4481995 to your computer and use it in GitHub Desktop.
BlocksIt 를 이용한 MediaQuerie 대체 용법
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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