-2

以下のコードをJSFiddleの先頭に追加したところ、機能しなくなりました。簡単な修正だと思いますが、わかりません。

$('html, body').animate({
    scrollTop: target.offset().top
}, 200);

// assign the correct target
var target = $('#if_two');

// scroll!
$('html, body').animate({
    scrollTop: target.offset().top
}, 200, function(){
    target.css({'border-color': 'red'})
});

私は何を間違っていますか?

4

3 に答える 3