ganzw 728f36a3b4 feat modify readme | há 8 anos atrás | |
---|---|---|
build | há 8 anos atrás | |
src | há 8 anos atrás | |
test | há 8 anos atrás | |
.gitignore | há 8 anos atrás | |
LICENSE | há 8 anos atrás | |
README.md | há 8 anos atrás | |
clipBoard.min.js | há 8 anos atrás |
with javascript operating clipboard, copy、cut and paste.
copy | cut | paste | |
---|---|---|---|
chrome | √ | √ | × |
Firefox | √ | √ | × |
IE7+ | √ | √ | √ |
var copy = new clipBoard(document.getElementById('data'), {
beforeCopy: function() {
},
copy: function() {
return document.getElementById('data').value;
},
afterCopy: function() {
}
});
copy will be called automatic, if you want call by yourself, you can do like this
var copy = new clipBoard(document.getElementById('data'));
copy.copyd();
document.getElementById('data') is the value target, you can also use it with jquery $('#data')
it same to copy
var cut = new clipBoard(document.getElementById('data'), {
beforeCut: function() {
},
Cut: function() {
return document.getElementById('data').value;
},
afterCut: function() {
}
});
or
var cut = new clipBoard(document.getElementById('data'));
cut.cut();
var cut = new clipBoard(document.getElementById('data'), {
beforeCut: function() {
},
Cut: function() {
return document.getElementById('data').value;
},
afterCut: function() {
}
});
or
var cut = new clipBoard(document.getElementById('data'));
cut.cut();
document.getElementById('data') is the paste target, you can also use it with jquery $('#data')