开发者

jQueryUI - "invalid label" error in console

Getting a JS error when I load the following script:

    // increase the default animation speed to exaggerate the effect
$.fx.speeds._default = 1000;
$(function() {
    $( "#dialog" ).live('dialog',function() {
        autoOpen: false,
        show: "blind",
   开发者_如何学Python     hide: "explode"
    });

    $( "#opener" ).live('click',function() {
        $( "#dialog" ).dialog( "open" );
        return false;
    });
});

Here is the console error:

invalid label - [Break on this error] show: 'blind',\n

Any ideas what is causing this?


You don't want to put the values into a function. They are properties of the dialog box directly.

$(function() {
    $( "#dialog" ).dialog({
        autoOpen: false,
        show: "blind",
        hide: "explode"
    });

    $( "#opener" ).live('click',function() {
        $( "#dialog" ).dialog( "open" );
        return false;
    });
});

See the jQuery UI Dialog documentation for more details. (There is an example of an animated dialog as well.)

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜