单击后如何关注自定义图像按钮? [英] How can I focus the custom image button after click that?

查看:64
本文介绍了单击后如何关注自定义图像按钮?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<cc1:CustomImageButton id="SoDtilButton" runat="server"

                                                                                                        ImageUrl="img/CM_b2_detail.gif"

                                                                                                        AlternateText="詳細"

                                                                                                        CommandName="Dtil"

                                                                                                        ClientFocusScript="defaultFunctionKeyBody">
                                                                                                    </cc1:CustomImageButton>









我创建了这样的按钮。我点击这个后想要关注这个按钮。







谢谢。





I created the button like this. I want to focus this button after I click this.



Thanks.

推荐答案

请回答我对这个问题的评论,以回应Andy Lanng的评论,以及他的评论。以下是整个事情:在大多数情况下,您的按钮将会聚焦。但如果不这样做,则意味着用户不想关注它。你不应该做任何事情。没有目的强制执行焦点非常糟糕。

但是,你总是可以使用JavaScript focus 方法:https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus [< a href =https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus\"target =_ blanktitle =New Window> ^ ]。



-SA
Please see my comment to the question, in response to the comment by Andy Lanng, as well as his comment itself. Here is the whole thing: your button will be focused in most cases. But if it won't, it means that the user does not want to focus it. You just should not do anything about it. It's really bad to enforce focus without a purpose.
However, you can always use JavaScript focus method: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus[^].

—SA


这篇关于单击后如何关注自定义图像按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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