禁用<按钮和GT;使用jQuery Mobile框架原因 [英] disable <button> with jQuery Mobile causes frame

查看:182
本文介绍了禁用<按钮和GT;使用jQuery Mobile框架原因的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的jQuery 2.0使用jQuery Mobile 1.4。

i am using jquery 2.0 with jquery mobile 1.4.

如果我禁用周围有一个按钮框架。它仍然存在,如果我再次启用该按钮。

if i disable a there is a Frame around the Button. It's still there if i enable the button again.

$("#speichern").button({disabled:true});  

按钮标记:

<button id="artSave" class="ui-btn ui-icon-plus ui-btn-icon-left ui-corner-all ui-btn-b"> speichern</button>

我不喜欢使用一个锚点,因为它不能完全禁用按钮。
我也有一些缺点与

按钮周围帧的图像

非常感谢

推荐答案

要禁用按钮 A 标签添加类 UI状态禁用。使用 .button() 部件只与输入键入按钮提交重置

To disable a button or a tags, add class ui-state-disabled. Use .button() widget only with input that has type button, submit or reset.

当您使用 .button()输入之外的任何元素,可以将其转换成输入按钮,因此你得到它周围的包装。

When you use .button() on any element other than input, you convert it into an input button and hence you get a wrapper around it.


  • 禁用/启用的输入按钮:

$(".selector").button("disable");
$(".selector").button("enable");


  • 禁用/启用按钮标签:

    $(".selector").addClass("ui-state-disabled");
    $(".selector").removeClass("ui-state-disabled");
    


  • 禁用/启用 A 锚标记:

    $(".selector").addClass("ui-state-disabled");
    $(".selector").removeClass("ui-state-disabled");
    


  • 演示

    Demo

    这篇关于禁用&LT;按钮和GT;使用jQuery Mobile框架原因的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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