我有一个我怀疑是一个简单的问题,搜索后我怀疑我的问题的答案是否定的,但要仔细检查......
I have what I suspect to be a simple question and after search I suspect the answer to my question to be no, but to double check...
是否可以在不设置 DIV 的情况下使用 Jquery ui 对话框?
Is it possible to use the Jquery ui dialog with out setting up a DIV?
ie 而不是..
$(function() { $( "#dialog" ).dialog();});...
<div id="dialog" title="我真的需要这个吗?">为了传递一个简单的信息,需要输入很多字</div>
是否有可能只是有类似...的东西
Is it possible just to have something like...
$(function(quickly) { $( "#dialog" ).dialog('这会容易得多');});...
并在需要时使用 quick() 类型的东西调用它.
and call it with a quickly() type thing when needed.
您可能会注意到,我可能会混淆 Javascript,并通过反复试验尽力找到适合我的解决方案.
You may note that I muddle may way through Javascript and do my best through trial and error to hit on a solution that works for me.
我想,我在问我是否可以以类似的方式使用对话框...
I suppose, I'm asking if I can somehow use dialog in a similar fashion to...
alert("这很简单")
...所以我可以在需要时向用户发出警报,而不是点击 url 或按下按钮.
...so I can call an alert to the user whenever I need to, rather than on url click or button press.
希望以上内容有意义,我怀疑我将不得不坚持丑陋的标准警报,但如果有简单的解决方案,请告诉我.
Hopefully the above make sense and I'll suspect I'll have to stick with the ugly standard alert but do let me know if there is a simple solution.
谢谢
希望对大家有帮助,你可以直接把html传给dialog,像这样:
I hope this helps somebody, you can pass html to dialog directly, like this:
$("<p>Hello World!</p>").dialog();
这样您就不必预先构建 div,您可以使用:
so this way you don't have to have a pre-builded div, you could use:
$("<div>My div content</div>").dialog();
将结束标记更改为 </div> 而不是 </p>
changed end tag to </div> instead of </p>
这篇关于Jquery-UI 对话框 - 在没有 DIV 的情况下运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
Angular 2:在本地 .json 文件中找不到文件Angular 2: file not found on local .json file(Angular 2:在本地 .json 文件中找不到文件)
使用模式 Angular 2 进行输入验证Input validation with pattern Angular 2(使用模式 Angular 2 进行输入验证)
如何在角度2中动态更改css类名How to change the css class name dynamically in angular 2(如何在角度2中动态更改css类名)
如何删除输入类型中的默认颜色?How to remove default color in input type?(如何删除输入类型中的默认颜色?)
如何将点击事件添加到打字稿中动态添加的html元How to add click event to dynamically added html element in typescript(如何将点击事件添加到打字稿中动态添加的html元素)
XPath 具有条件的多个属性值之一XPath one of multiple attribute values with condition(XPath 具有条件的多个属性值之一)