javascript 替代Javascript提示框

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11905294/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-26 14:43:26  来源:igfitidea点击:

Alternative to Javascript prompt box

javascripthtmljquery-uijquery-plugins

提问by Alston

Does anyone can suggest me the alternative to Javascript prompt box? Check it out.
Since the input box is designed for children, I want the prompt box to be more colorful and lively. Any suggested existing box?
The limitation is that I have to let the user enter a string, receiving it.
Thanks.

有没有人可以建议我替代 Javascript 提示框? 看看这个。
由于输入框是为儿童设计的,所以我希望提示框更加丰富多彩和活泼。任何建议的现有框?
限制是我必须让用户输入一个字符串,接收它。
谢谢。

回答by Vishnu

Have you tried out BootBox?

你试过BootBox吗?

Bootbox.js is a small JavaScript library which allows you to create programmatic dialog boxes using Twitter's Bootstrap modals, without having to worry about creating, managing or removing any of the required DOM elements or JS event handlers.

Bootbox.js 是一个小型 JavaScript 库,它允许您使用 Twitter 的 Bootstrap 模式创建程序化对话框,而无需担心创建、管理或删除任何必需的 DOM 元素或 JS 事件处理程序。

It has a very neat alternative to the default JavaScript Prompt box.

它有一个非常巧妙的替代默认 JavaScript 提示框。

回答by hugohabel

Have you tried the jQuery UI library?

您是否尝试过 jQuery UI 库?

Here you can see an example of a modal form

在这里你可以看到一个模态表单的例子

You can modify the styles or select from different themes.

您可以修改样式或从不同的主题中进行选择。

回答by Sumukh Barve

I find the browser's prompt (, confirm and delete) boxes extremelyannoying.

我发现浏览器的提示(、确认和删除)框非常烦人。

Partly to solve this problem, I've written iocream.js. It's a sample wrapper around the DOM with two text-input methods: jin(read like C++ ' s cin) and jinarea.

部分是为了解决这个问题,我编写了 iocream.js。它是围绕 DOM 的示例包装器,具有两种文本输入方法:(jin读起来像 C++ 的cin)和jinarea

You can find the docs at this bitbucket repo, and examples here.

您可以在此 bitbucket 存储库中找到文档,并在此处找到示例。

Hope I helped.

希望我有所帮助。

EDIT:I've posted a similar answer here.

编辑:我在这里发布了类似的答案

回答by Liam

the Jquery UI one's good: http://jqueryui.com/demos/dialog/

Jquery UI 不错:http: //jqueryui.com/demos/dialog/

回答by Clyde Lobo

A jquery plugin named Impromptugives you a lot of options not only for prompts but also for alerts and confirm boxes

一个名为Impromptu的 jquery 插件为您提供了很多选项,不仅用于提示,还用于警报和确认框

回答by Philip White

qtip2 is another nice free javascript library http://qtip2.com/

qtip2 是另一个不错的免费 javascript 库http://qtip2.com/