I\'m trying to figure out how to disable a button if margin-left
on an element is equals to -3200
pixels. Ive the following that seems to run my functi
You missed dot
before offset() and need to use ==
instead of =
for equality
comparison.
if($('.hero-carousel').offset().left == -3200) {
alert('test');
}
Edit
For getting margin left you need to use css function instead of offset()
if($(".hero-carousel").css("margin-left") == -3200 + "px") {
alert('test');
}