Created
July 14, 2017 11:18
-
-
Save pytlus93/495c62a11659c4be67ddab6cd018ece0 to your computer and use it in GitHub Desktop.
Get value of css width for class
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 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