Created
August 4, 2015 09:37
-
-
Save ghorvat/233def103ded67c2b6d8 to your computer and use it in GitHub Desktop.
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
<script> | |
var expTiles = jQuery('[class*="col-"]'); | |
var tmpCount = 0; | |
var nextIsFirst = false; | |
var maxInRow = 9; | |
expTiles.each(function(){ | |
var myColumns; | |
if(nextIsFirst){ | |
$(this).addClass('first'); | |
nextIsFirst = false; | |
tmpCount = 0; | |
} | |
myColumns = parseInt(this.className.match(/col-test-(\d+)/)[1],10); | |
tmpCount += myColumns; | |
console.log(tmpCount); | |
if(tmpCount >= maxInRow){ | |
nextIsFirst = true; | |
} | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment