parseInt($(this).css('marginBottom'), 10);
parseInt
will automatically ignore the units.
For example:
var marginBottom = "10px";
marginBottom = parseInt(marginBottom, 10);
alert(marginBottom); // alerts: 10
More Related Contents:
- Parsing CSS in JavaScript / jQuery
- required field notification using jquery
- CSS or jQuery : How to get visible top [duplicate]
- Write tags in HTML and print
- How to disable HTML links
- Refresh/reload the content in Div using jquery/ajax
- Animate element to auto height with jQuery
- What is difference between width, innerWidth and outerWidth, height, innerHeight and outerHeight in jQuery
- Change CSS of selected text using Javascript
- Modifying CSS class property values on the fly with JavaScript / jQuery
- How to get nth-child selector to skip hidden divs [duplicate]
- Does .css() automatically add vendor prefixes?
- How to auto-scroll to end of div when data is added? [duplicate]
- Disable dragging an image from an HTML page
- Am I using too much jQuery? When am I crossing the line?
- Use a new CSS file to override current website’s
- Iterating through/Parsing JSON Object via JavaScript
- Fullpage.js. Adding a scroll delay
- Check if element is between 30% and 60% of the viewport
- How to show live preview in a small popup of linked page on mouse over on link?
- Fade background image in and out with jQuery?
- How do I detect the inherited background-color of an element using jQuery/JS?
- Convert dropdown to selection boxes with color and trigger drop down action
- Rotate div text after clicking on button using jquery and css
- How do I find which JavaScript is changing an element’s style?
- How to Bootstrap navbar static to fixed on scroll?
- How to use pagination on HTML tables?
- how to use html2canvas and jspdf to export to pdf in a proper and simple way
- How can I reorder elements with JavaScript?
- Can you have multiple lines in an element?