Given an element with unknown margin-left, how to increase its margin-left at a number say 100px?
For example:
assuming the original margin-left is 100px
the expected result is 100px + 100px thus 200px finally.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
curValue will include ‘px’ at the end, so you’ll end up with
NaNor100px100pxas your result without usingparseIntfirst.