Skip to content

Instantly share code, notes, and snippets.

@brunobar79
Created December 17, 2014 19:21
Show Gist options
  • Select an option

  • Save brunobar79/803c37fd58c3f6bbff0d to your computer and use it in GitHub Desktop.

Select an option

Save brunobar79/803c37fd58c3f6bbff0d to your computer and use it in GitHub Desktop.
Cols fn
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