I have the following code:
$('.uiModalWrapper').live('click', function() {
var modal = $(this).find('.uiModal');
modal.addClass('shake');
modal.addEventListener('webkitAnimationEnd', function() {
modal.removeClass('shake');
});
});
Which should add a class called shake to an element when it's clicked and then remove it again when the webkitAnimationEnd event takes place. However it causes an error Uncaught TypeError: Object [object Object] has no method 'addEventListener'
Any ideas on how to fix this? Thanks