Can someone help me with a quick question about CSS? I need to compare two style attributes, specifically margin-left. If the margin-left is less than 500px, I don't want to make any changes. However, if it's greater than 500px, I want to add another 500px of margin.
Just in case you were wondering, this is for an image slider :)
I've attempted to solve it using jQuery:
$('.slider-nav .left').click(function(){
if($('.slide li').css('margin-left') < '500px'){
// Do Nothing
} else {
$('.slide li').animate({'margin-left': '-=500px'}, animationSpeed);
}
});
I know this code is not correct, but I'm struggling to find another solution. Can anyone point me in the right direction?