views:

34

answers:

1

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",
        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?

+1  A: 

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.)

JasCav
whoops, went a little crazy there with live()
JasCav, I'm getting the message now "uncaught exception: cannot call methods on dialog prior to initialization" in firebug console. A search didn't reveal much information about that. Any ideas?