如何将注意力集中在“取消”上打开bootstrap dialog.confirm弹出窗口上的按钮 [英] how to set focus on "cancel" button on open bootstrap dialog.confirm popup

查看:266
本文介绍了如何将注意力集中在“取消”上打开bootstrap dialog.confirm弹出窗口上的按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好先生,

i想要设置默认焦点取消按钮,然后bootstrapdialog.confirm弹出窗口打开..

i在google搜索但没有找到任何结果..



怎么做?

hello sir,
i want to set default focus on "cancel" button whnen "bootstrapdialog.confirm" popup open..
i searched in google but not find any result..

How TO do ?

推荐答案

这里:http://www.w3schools.com/jsref/met_html_focus.asp [ ^ ]。



-SA


通过对话框确认,你在bootstrap中意味着这些扩展之一吗?



http://ethaizone.github.io/Bootstrap-Confirmation/ [ ^ ]







http:// nakup anda.github.io/bootstrap3-dialog/ [ ^ ]



无论如何,这里有一个jsfiddle演示如何启动一个bootstrap(plain 3.x)模态并在模态启动后将焦点设置在取消按钮上(这样输入键应该触发取消按钮的点击事件)。



http://jsfiddle.net/jchoponis/orvdfmLe/3/ [ ^ ]



,因为你最有可能使用bootstrap 3.x的扩展,我认为这个jsfiddle仍然相关很容易适应。



希望这会有所帮助。
by the dialog confirmation, are you meaning one of these extensions on bootstrap?

http://ethaizone.github.io/Bootstrap-Confirmation/[^]

or

http://nakupanda.github.io/bootstrap3-dialog/[^]

anyhow, here's a jsfiddle that demonstrates how to launch a bootstrap (plain 3.x) modal and set the focus on the cancel button after the modal launches (that way the enter key should trigger the click event of the cancel button).

http://jsfiddle.net/jchoponis/orvdfmLe/3/[^]

since you are most likely using an extension of bootstrap 3.x, i'm thinking this jsfiddle is still relevant and could be adapted pretty easily.

hope this helps.


啊。这个库看起来很酷!

http://nakupanda.github.io/bootstrap3-dialog/ [ ^ ]



请注意,在可用选项部分,您可以在按钮上设置css类...您也可以设置id值。

还有,有一个选项运行onshown方法。



您可以使用我在下面的网站(btn-ok)中获取的示例中设置的ID,所以像这样:



ah. this library does look pretty cool!
http://nakupanda.github.io/bootstrap3-dialog/[^]

note that in the "available options" section, you can set css classes on buttons...you can also set the id value.
also, there's an option to run a method "onshown".

you could use set the id as desired in the example i took from their site below ("btn-ok") and so something like this:

(


这篇关于如何将注意力集中在“取消”上打开bootstrap dialog.confirm弹出窗口上的按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆