I have the following div :
<div id="new" style="position: absolute; z-index: 100; top: 210px; width: 195px.. What is the best way to increase the top property when an event occurs?
Note that I've tried: $('#new').css('top')+10 but the problem is that .css returns string.
The simplest way is to use the += operator:
$( '#new' ).css( 'top', '+=10px' );
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With