/ Published in: jQuery
A quick snippet that removes the 'px' when accessing a value through jquery, and converts it into an integer.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
parseInt($('.element-class').css('width').replace(/[^-\d\.]/g, '')); Usage would be: var totalWidth = parseInt($('.portfoliowrapper').css('width').replace(/[^-\d\.]/g, ''));