Once you make the call to show dialog A, you could just do a simple
timeout function to close it a few seconds later like this:
setTimeout(function(){ $("#dialogA").dialog("close"); }, 5000); //
closes it 5 seconds later, you'll need the id for the dialog and can
change the timeout to whatever you want
Or, right before you run the code to show dialog B, run this:
if ( $("#dialogA").dialog("isOpen") ) $("#dialogA").dialog
("close"); //again, you'll need the property id or way to get the
jQuery object for the dialog
Another alternative is to use a growl alert instead of the first
dialog. I prefer this because users are not accustom to seeing
dialogs just disappear (especially if they may be in the middle of
reading or responding to it.) If the message is just informational
(doesn't require a response) consider a growl or removed the okay
button from the dialog. See: http://stanlemon.net/projects/jgrowl.html
and http://malsup.com/jquery/block/#demos for jquery growl examples.
Hth,
Dave
On Sep 29, 10:11 am, mickbw <[email protected]> wrote:
> I have a dialog box (Dialog A) that lets the user know a page will
> take a minute or more because a lengthy report is being generated.
>
> Once the report has generated another dialog box (Dialog B) is
> displayed saying the report has been generated and giving further
> options through dialog buttons.
>
> The problem is that depending on how attentive the end user is Dialog
> B could load on top of Dialog A requiring extra clicks and confusing
> the end user.
>
> I would like to use a timer to make Dialog A fade away after 10-15
> seconds but am having trouble finding an example to do this. If
> someone could post example code or provide a link to a page that would
> explain how to do this, I would be eternally grateful.
>
> The script itself is very vanilla but I will provide it below.
>
> <script type="text/javascript">
> $(document).ready(function() {
> <cfoutput>
> var #toScript(trimmed, "whichDebtType")#
> var #toScript(whichval, "val2seek")#
> </cfoutput>
> if(whichDebtType == 0) {
> var jicon = '<span class="ui-icon ui-icon-alert"
> style="float:left;
> margin:0 7px 50px 0;"></span>'
> var jid = 'No value provided for ' + val2seek
> + '<br>Click OK to
> set report parameters';
> var jtitle = 'Missing Value for Report';
> var $dialog = $('<div></div>')
> .html(jid)
> .dialog({
> bgiframe: true,
> autoOpen: false,
> modal: true,
> //buttons: {"OK": alert('okay')},
> buttons: {
> "OK": function() {
> //do something;
> ColdFusion.navigate('Reporting.cfm','center');
> $(this).dialog("close");
> },
> "Cancel": function() {
> $(this).dialog("close");
> }
> },
> title: jtitle })
> $dialog.dialog('open');
> }
> });
> </script>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"jQuery UI" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/jquery-ui?hl=en
-~----------~----~----~----~------~----~------~--~---