BootStrap中按钮点击后被禁用按钮的最佳实现方法
//禁用button $('button').addClass('disabled'); // Disables visually $('button').prop('disabled', true); // Disables visually + functionally //禁用类型为button的input按钮 $('input[type=button]').addClass('disabled'); // Disables visually $('input[type=button]').prop('disabled', true); // Disables visually + functionally //禁用超链接 $('a').addClass('disabled'); // Disables visually $('a').prop('disabled', true); // Does nothing $('a').attr('disabled', 'disabled'); // Disables visually 将上面方法写入点击事件中即可,如:$(".btn-check").click(function () { $('button').addClass('disabled'); // Disables visually $('button').prop('disabled', true); // Disables visually + functionally }); js按钮点击后几秒内不可用:function timer(time) { var btn = $("#sendButton"); btn.attr("disabled", true); //按钮禁止点击 btn.val(time <= 0 ? "发送动态密码" : ("" + (time) + "秒后可发送")); var hander = setInterval(function() { if (time <= 0) { clearInterval(hander); //清除倒计时 btn.val("发送动态密码"); btn.attr("disabled", false); return false; }else { btn.val("" + (time--) + "秒后可发送"); } }, 1000); } //调用方法 timer(30);BootStrap中按钮点击后被禁用按钮的最佳实现方法的更多相关文章
- Bootstrap中宽度大于指定宽度时有空白的解决方法
<div class="container-fluid"></div> 其中container-fluid的作用是占100%
- 如何在winform DataGridView控件的DataGridViewButtonColumn按钮列中禁用按钮
原文:http://msdn.microsoft.com/en-us/library/ms171619(v=vs.85).ASPX public class DataGridViewDisableBu ...
- bootstrap注意事项(六)按钮
1.预定义样式 使用下面列出的类可以快速创建一个带有预定义样式的按钮 <!DOCTYPE HTML><html><head> <link rel=" ...
- Bootstrap知识记录:表格和按钮
基本格式.table3.带边框的表格//给表格增加边框<table class="table table-bordered">4.悬停鼠标//让<tbody> ...
- bootstrap 学习笔记(4)---- 按钮
平常我们自己写按钮,这次不用我们自己写 了,直接应用bootstrap中的按钮样式,就能设计出很漂亮的按钮样式.接下来就让我们一起学习吧. 1.可以作为按钮使用的标签或元素:<a>< ...
- bootstrap基础学习【菜单、按钮、导航】(四)
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...
- Dynamics 365 CE命令栏按钮点击后刷新表单页面方法
微软动态CRM专家罗勇 ,回复326或者20190428可方便获取本文,同时可以在第一间得到我发布的最新博文信息,follow me! Dynamics 365 Customer Engagement ...
- js中confirm揭示三个按钮“是”“否”“取消”
js中confirm提示三个按钮“是”“否”“取消” 重载DOM中confirm window.confirm = function(str) { str=str.replace(/\'/g, & ...
- JQuery脚本-通过禁用按钮防止表单重复提交
<script type="text/javascript"> /* jquer 脚本,避免重复提交 隐藏点击的submit,后在他之后插入同名button伪装成被隐藏 ...
随机推荐
- Dubbo 基础介绍
1.学习背景 随着互联网的发展,越来越多的企业每天处理着上亿级的请求,以及每秒几万的并发操作,对于传统的 JavaWeb 工程师是一个巨大的挑战.然而越来越复杂的业务以及数据库设计使得代码变得非常庞大 ...
- Rsync启动停止脚本
网上找了个完善的rysnc启停脚本:http://linux5588.blog.51cto.com/65280/779000 rsync源码: [root@lanny d4]# cat rsync_s ...
- javascript 图片上传缩略图预览
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="C ...
- ny523 亡命逃串 hdoj 1253胜利大逃亡
亡命逃窜 时间限制:1000 ms | 内存限制:65535 KB 难度:4 描述 从前有个叫hck的骑士,为了救我们美丽的公主,潜入魔王的老巢,够英雄吧.不过英雄不是这么好当的.这个可怜的娃被魔 ...
- 纯css3实现的3D按钮
前面已经为大家介绍了好多纯css3实现的按钮.今天要再给大家带来一款纯css3实现的3D按钮.在实例中给出了五种颜色的3D按钮.效果图如下: 在线预览 源码下载 实现的代码. html代码: &l ...
- MongoDB学习之(一)安装
第一步:下载MongoDB的安装版进行安装 https://pan.baidu.com/s/1X3hIqORJ61TCG1UJ_yr6ag 由于第二次安装出现一些问题,所有还是记录一下,免得以后踩坑. ...
- Java web 项目读取src或者tomcat下class文件夹下的xml文件或者properties文件
//生成一个文件对象: File file = new File(getClass().getClassLoader().getResource("test.xml").getPa ...
- R-tree 一种空间搜索的动态索引结构
译林:R-tree 一种空间搜索的动态索引结构Antonm Guttman 摘要为了有效地处理空间数据,正如在计算机辅助设计和地理数据应用中所要求的那样,数据库需要一种索引机制能根据它们的空间位置快速 ...
- ExtJs Ext.form.field.TextArea+Ckeditor 扩展富文本编辑器
Ext.define("MyApp.base.BaseTextArea", { extend: "Ext.form.field.TextArea", xtype ...
- uboot中CMD的实现
CMD配置位于config_cmd_default.h configs/at91/sam9g10ek.h 头文件位于include/command.h 41 struct cmd_tbl_s { ...