Created
December 17, 2014 19:21
-
-
Save brunobar79/803c37fd58c3f6bbff0d to your computer and use it in GitHub Desktop.
Cols fn
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
| function colsWidth($num_cols,$total_width, $total_cols, $gutter_width){ | |
| if(typeof $total_cols === undefined){ | |
| $total_cols = 6; | |
| } | |
| if(typeof $gutter_width === undefined){ | |
| $gutter_width = 10; | |
| } | |
| var col_width = ($total_width - ($gutter_width * 2 * $total_cols) ) / $total_cols; | |
| return (col_width * $num_cols) + (($gutter_width * 2) * ($num_cols - 1)); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment