A-A+
Bootstrap中点击按钮后变灰并显示加载中例子
Bootstrap插件非常的好用了,我们今天一起来看一篇关于Bootstrap实现点击按钮之后按钮变成不可点击的一个效果了,具体的如下所示.
1.在按钮中加入data-loading-text,即点击按钮后显示的文字
- <button type="submit" class="btn btn-primary btn-check" data-loading-text="提交中...">添加成员</button>
2.当点击按钮后禁用按钮,并显示文字。如需绑定其他事件请自行更改。第二三行为重要内容。
- $(".btn-check").click(function () {
- $(this).button('loading');//禁用按钮并显示提交中
- $(this).button('reset');//重置按钮
- });
3.设置disabled属性为true即为不可用状态。
- document.getElementByIdx("btn").disabled=true;
- jquery
- $("#btn").attr("disabled", true);
- html:
- <input type="button" value="提交" id="btn">
Bootstrap中,一个按钮点击后,改变按钮颜色。在就是点击过后不能在点击事件按钮的,要等另一个事件触发才能点击,请问怎么做??能举个简单的实例u