将$(this)传递给jQuery fadeOut回调

1 javascript jquery function effects callback

我知道我需要使用一个回调,这样html()不会发生,直到后fadeOut(),但里面fadeOut()的回调,我没有访问$(this).hover.

我尝试使用选择var point,但它不起作用.

if(!$.browser.msie) {
    points = $("div.point");
} else {
    points = $("div.flash");
}
Run Code Online (Sandbox Code Playgroud)

问题领域:

$(points).hover(
        function () {
            var point = $(this);

            $('#features_key').fadeOut('normal', function(point) {
                $('#features_key').html(point.next('.info').clone()).fadeIn('normal');
            });
        }, 
        function () {
        }
    );
Run Code Online (Sandbox Code Playgroud)

HTML:

<div class="feature" id="feature0">
    <div class="point"></div>
    <div class="info"><p>Roof System</p></div>
</div>
Run Code Online (Sandbox Code Playgroud)

Phi*_*ert 8

不要将point用作fadeOut回调的参数.它将隐藏您之前"捕获"的点变量:

$(points).hover(
    function () {
            var point = $(this);

            $('#features_key').fadeOut('normal', function() {
                    $('#features_key').html(point.next('.info').clone()).fadeIn('normal');
            });
    }, 
    function () {
    }
);
Run Code Online (Sandbox Code Playgroud)