fixed webkit error be disable a button

This commit is contained in:
Oskar Hahn 2012-04-15 12:40:35 +02:00
parent 4d7940cb12
commit ae5c6b84a8

View File

@ -1,9 +1,13 @@
$(function () {
$('.button').click(function () {
$('.button').click(function (event) {
button = $(this);
button.attr('disabled', 'disabled');
setTimeout(function () {
button.removeAttr('disabled');
}, 1000);
if (button.hasClass('disabled')) {
event.preventDefault();
} else {
button.addClass('disabled');
setTimeout(function () {
button.removeClass('disabled');
}, 1000);
}
});
});