I'm working on an image uploader app, and everything is working great except for one bug, which is occurring only in Chrome. I've stripped down the problem to one callback which isn't going through.
The issue is that a .fadeOut callback to a .click() trigger isn't triggering. I've recreated a simplified version in a fiddle which is linked below. The first click starts the fadeOut, and when the fadeOut is finished, the .click trigger doesn't happen. Clicking a second time Does then trigger the trigger. Any ideas why?
HTML:
<div><input type="file" name="image_file" id="image_file"/></div>
<div class="overlay_wrap">
Overlast
</div>
<a id="click" href="">Click</a>
jQuery:
$(document).ready(function() {
$("#click").click(function(event) {
event.preventDefault();
$('.overlay_wrap').fadeOut(1000, function(event){
$('#image_file').trigger('click');
});
});
});
Thank you for the help!
EDIT: Had the old Fiddle link, changed.