5/12 .dbclick() not working?


#1

In this exercise, you need to make a div fadeOut('fast); when it is double clicked. Easy:

$(document).ready(function() {
$('div').dbclick(function() {
$(this).fadeOut('fast');
});
});

But the log returns "TypeError: $(...).dbclick is not a function" I run the code, and nothing happens.


However when I change line 2 to:

$('div').click(function() { .....

it works fine, but not for double clicking. It will allow me to go on to the next section, but I was wondering if this is a bug or if I just did something wrong.

Thanks
--Joe


#2

You have .dbclick()
Its .dblclick


#3

What's wrong with above code? please point out


#4

Please paste in your code + error and lesson


#5

$(document).ready(function() {
$('.d').dbclick(function() {
$(this).fadeOut('fast');
});

});

TypeError: $(...).dbclick is not a function

but the same code works with click() function.


#6

You have the same mistake as above learner

You have .dbclick()
Its .dblclick