I make a script. That load a new image in a img tag. This is the script:

```
button.click(function(e) {
    e.preventDefault();

    var url = $(this).attr("href");
    var img = $('#photo-gallery .teaser img');

    $('li', list).attr('data-flag', 'close');

    img.animate({ opacity: 0 }, 500, function() {
        $('img', teaser).attr("src", url);
    });

    img.animate({ opacity: 1 }, 500)

    $(this).closest('li').attr('data-flag', 'open');
});

```

But, i have a problem with this script. When you click fast on a button. If you are very quick succession click. Than the script doing al that click events. How can i fix that.