自己常用JS和JQ 函数
<button >点击发送验证码</button>


<script src="jquery.min.js"></script> <script> $('#send').click(function(){ //发生送验证码函数 //.... time($(this)); }) var wait=60;//时间 function time(o){//o为按钮的对象,p为可选,这里是60秒过后,提示文字的改变 if (wait == 0) { o.removeAttr("disabled"); o.text("点击发送验证码");//改变按钮中value的值 wait = 60; } else { o.attr("disabled", true);//倒计时过程中禁止点击按钮 o.text(wait + "秒后重发");//改变按钮中value的值 wait--; setTimeout(function() { time(o);//循环调用 }, 1000) } } </script>
自己常用JS和JQ 函数

 //生成随机数

// 生成随机数
function randombetween(min, max){
    return min + (Math.random() * (max-min +1));
}

//阻止冒泡

自己常用JS和JQ 函数
function stopBubble(e){
    e = e || window.event;  
    if(e.stopPropagation){
        e.stopPropagation();  //W3C阻止冒泡方法  
    }else {  
        e.cancelBubble = true; //IE阻止冒泡方法  
    }  
}
自己常用JS和JQ 函数

 

相关文章:

  • 2021-05-24
  • 2021-11-24
  • 2022-12-23
  • 2022-12-23
  • 2022-01-08
  • 2022-12-23
  • 2019-09-19
  • 2021-11-03
猜你喜欢
  • 2022-12-23
  • 2021-08-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-27
相关资源
相似解决方案