开发者

Why is this not a valid, chained function?

开发者 https://www.devze.com 2023-02-11 23:10 出处:网络
$(\"#infoBox\").hide(, function(){ alert(\'hidden!\'); }); Just a sm开发者_StackOverflowall question, but my code breaks when I try to do this -You cannot simply omit the first parameter. You need t
$("#infoBox").hide(, function(){
            alert('hidden!');
        });

Just a sm开发者_StackOverflowall question, but my code breaks when I try to do this -


You cannot simply omit the first parameter. You need to supply a value for it e.g.:

$("#infoBox").hide('slow', function(){
    alert('hidden!');
});

See the API page for information on what available values there are for the first parameter (duration).


change this to

$("#infoBox").hide('slow', function(){
            alert('hidden!');
        });


jQuery will work out what do do if you omit the speed argument in this case

$( "#infoBox" ).hide( function() {
    alert( 'hidden!' );
});
0

精彩评论

暂无评论...
验证码 换一张
取 消