D
D
Denis Bukreev2016-06-08 11:03:59
css
Denis Bukreev, 2016-06-08 11:03:59

How to add css value with jQuery?

Such cases: there is an element. The element has a padding-top. I need to increase this padding-top by some value.

As far as I remember (I saw it somewhere), this type of record is: Is this the right way?
$(element).css('padding-top', + value);

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Egor Rublev, 2016-06-08
@denisbookreev

+= it is necessary, then it will be to add an arbitrary indent to the indent already received.

D
Dmitry Kravchenko, 2016-06-08
@mydearfriend

$(element).css('padding-top', parseFloat($(element).css('padding-top'))+ value);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question