Skip to content

Instantly share code, notes, and snippets.

@pytlus93
Created July 14, 2017 11:18
Show Gist options
  • Save pytlus93/495c62a11659c4be67ddab6cd018ece0 to your computer and use it in GitHub Desktop.
Save pytlus93/495c62a11659c4be67ddab6cd018ece0 to your computer and use it in GitHub Desktop.
Get value of css width for class
function width(that)
{
var $class = $(that).hasClass('col-md-12') ? 'col-md-9' : 'col-md-12';
var element = $('<div/>').addClass($class).appendTo('body').wrap('<div style="display: none"></div>');
var width = element.css('width');
element.remove();
return width;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment