【问题标题】:How to setup jquery ui dialog display如何设置jquery ui对话框显示
【发布时间】:2014-08-23 02:51:05
【问题描述】:

我有表格中的代码

  • 不提交任何东西:<div class="screen-reader-response"></div>
  • 提交:<div class="screen-reader-response" role="alert">My Content alert<div>

我是用户代码:

$( ".screen-reader-response" ).dialog();

问题:当我不提交任何东西时:没有内容的回显对话框

如何设置:

如果:没有提交任何东西:<div class="screen-reader-response"></div> 没有回显警报 if: have submit: <div class="screen-reader-response" role="alert">My Content alert<div> echo alert My Content alert

你有什么想法吗?

访问我的网站:http://www.graylinecruisehalong.net/ 不提交时总是对话内容?

【问题讨论】:

标签: javascript jquery jquery-ui alert jquery-ui-dialog


【解决方案1】:

没有提交时:

$(".screen-reader-response").html("").dialog('open');

提交时:

$(".screen-reader-response").html("My Content alert").dialog('open');    

要使用更多选项初始化对话框,请查看 jquery 对话框的文档:http://api.jqueryui.com/dialog/

【讨论】:

  • 我正在使用$( ".screen-reader-response" ).dialog(); 运行,但如果#myDialog 中没有内容则不想运行
  • 是的,我已经更新了代码。请检查一下。我想这就是你要找的。​​span>
  • 我正在添加代码:当没有提交时 => 没有回显对话框 (true) - 但是当我完成时 => 没有回显对话框 (false) ???
  • $(".screen-reader-response").html("My Content alert").dialog('open'); 如果html("My Content alert") 没有一个值??如何打开?
  • 对此我已经在答案中提到了当没有提交时。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-07-21
  • 1970-01-01
  • 1970-01-01
  • 2011-02-23
  • 2010-09-28
  • 1970-01-01
相关资源
最近更新 更多