jQuery has height() en width() functions that returns the height or width in pixels as integer...
How can I get a padding or margin value of an element in p
Don't use string.replace("px", ""));
Use parseInt or parseFloat!