Get Yourself In


#1

$(document).ready(function(){
$('div').mouseenter('hide').fadeTo('fast',100);
});

why cant we write like this. mouseenter and fadeTo is predefined actions right ? if above syntax and code is good they why am i getting the error.


#2

mouseenter like ready are listener functions, only. They cannot handle the events they are listening for, only pass them on to a handler function. So it must be,

...listener(function() {
    ...listener(function() {

    });
});

As in,

$(document).ready(function () {
    $('div').mouseenter(function () {
        $(this).hide().fadeTo('fast',100);
    });
});

#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.