Giter VIP home page Giter VIP logo

jquery.zeroclipboard's Introduction

zeroclipboard jQuery plugin - 点击复制文字插件

  1. Git
  2. Online Demo
  3. David

介绍 - Introduction

  1. 修改自 zeroclipboard plugin - Modify by zeroclipboard v1.1.7;
  2. 能够绑定 selector, 每次 createElement 时都会拥有该方法, 不用重复绑定;
  3. $.fn.copy 即可调用, 但是必须点击才能触发复制 因为不点击会禁止;
  4. 通过 e.copyText() 函数进行绑定;

实例 - Demo

冒泡形式绑定 live

$(document).on('copy', 'button', function(e) {
	var text = $('#copyText').val();
	e.copyText(text); // 必须 copyText
	trace('copy success');
	$('#test').focus();
});

普通形式绑定

$('#copy').bind('copy', function(e) {
	var text = $('#copyText').val();
	e.copyText(text);
	trace('copy success');
	$('#test').focus();
});

jquery.zeroclipboard's People

Contributors

davidkk avatar

Watchers

 avatar  avatar  avatar

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.