Giter VIP home page Giter VIP logo

angular-lazy-click's Introduction

lazy-click

描述

按钮执行点击事件后,默认2s内点击操作失效,并在2s内添加disabled类, 2s后恢复初始状态

install

npm i angular-lazy-click --save

or

bower i angular-lazy-click --save

demo

angular.module('[your module]', ['angular-lazy-click'])

angular.controller('test', function($scope) {
  $scope.test1 = function() {
    console.log(1);
  }

  $scope.test2 = function(string) {
    console.log(string);
  }
});
<!-- 初始状态 -->
<div class="" lazy-click="test1();test2('string');">Test</div>

<!-- 点击后两秒内 , 点击无效 -->
<div class="disabled" lazy-click="test1();test2('string');">Test</div>

<!-- 点击后两秒后 -->
<div class="" lazy-click="test1();test2('string');">Test</div>

属性

lazy-click, 与ng-click用法一致

lazy-click-time, 点击失效时间,默认为2s,允许不设置,格式: lazy-click-time="3000"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.