luukgruijs
luukgruijs

Reputation: 129

Remove animation after finishing

I use the jQuery below to create a scrolling effect. It also animates a border. But after the animation has finished I would like it to go back to default again, so that it has no border any more.

$('#scroll').click(function(){
    $(".scroll").animate({
        borderWidth: "3px"
    }, 3000);
});

$('#scroll').click(function(){ 
    var delay = 3000; 
    setTimeout(function() {
        $('.vluchtelinginfo').scrollTo( '+=100px', 800 );
    }, delay);                      
});

Upvotes: 0

Views: 108

Answers (1)

Harsha Venkataramu
Harsha Venkataramu

Reputation: 2914

Try this code.

$('#scroll').click(function(){
    $(".scroll").animate({
        borderWidth: "3px"
    }, 3000,function(){
          $('.scroll').css('borderWidth','');
   });
});

Upvotes: 1

Related Questions