Can I use the following code to compare the value of the attribute “left” ?
if ($('.pager').css('left') < 100 + 'px')
Or should I different code ? (My issue is how to deal with ‘px’, if I should remove it or at least use it consistently in the code.
thanks
Just use
parseInt, it will ignore thepxfor you:Or you can use the
leftproperty withinposition():