0

I have the following function:

function carousel_go_right($container, pos_width){
    $container.attr('disabled', 'disabled');
    $container.animate({
        left: '-=' + pos_width
    }, 500, function() {
        $container.attr('disabled', '');
    });
}

The problem is that the "disabled" attribute does not change to "" after the animation is done. I also tried $(this).attr('disabled', '') and it still doesn't work.

console.log($container.attr('disabled')) in the callback function shows the right value

Blazemonger
  • 90,923
  • 26
  • 142
  • 180
Zack
  • 385
  • 2
  • 3
  • 21

1 Answers1

0

You should treat disabled as a property, not an attribute:

$container.prop('disabled',false);

http://api.jquery.com/prop

Community
  • 1
  • 1
Blazemonger
  • 90,923
  • 26
  • 142
  • 180