tags:

views:

60

answers:

2

Hi,

I have setup the following jQuery UI Dialog within my document.ready() section, i.e:

        $("#dialog").dialog({
            autoOpen: false,
            bgiframe: true,
            resizable: false,
            modal: true,
            buttons: {
              'Ok': function() {               
                      $(this).dialog("close"); 
                    }
        }
    });

1) My question is which I am unsure of, is that within my javascript code, I have a counter, which when it hits a particular value, would like my dialog window to appear.

Unsure how to achieve or trigger this?

2) Within the jQueryUI website, I am trying to download the "Custom Theme" from http://jqueryui.com/download/?themeParams=%3Fctl%3Dthemeroller but nothing seem to happen, i.e no dialog save box appears.

Any ideas?

Thanks.

+1  A: 

1) If you want the dialog appear only when that condition is met, you should set the autoOpen option to false, later in your code, after you increment your counter variable, you should check its value and show it if the counter has the particular value you look for, i.e.:

// ...
counter++;
if (counter == 100) {
  $('#dialog').dialog('open');
}
// ...

2) To build your custom theme, use ThemeRoller.

CMS
thanks CMS - I realised that I had autoOpen set to true - have now changed it back to false in this thread. Thanks also on the ThemeRoller - haven't really used this before.
tonsils
You're welcome tonsils!
CMS
+1  A: 

First question:

When you hit desired counter value do this:

$("#dialog").dialog("open");
del-boy