Home > Web Front-end > JS Tutorial > jquery tutorial on using the jquery.zclip plug-in to copy objects_jquery

jquery tutorial on using the jquery.zclip plug-in to copy objects_jquery

WBOY
Release: 2016-05-16 17:10:58
Original
1669 people have browsed it

Copy code The code is as follows:



Copy code The code is as follows:

$(function(){
$(' #copy_input').zclip({
path: 'js/ZeroClipboard.swf',
copy: function(){//Copy content
return $('#mytext').val();
                                                                                                                                                                                                                                                                                       afterCopy: function(){//Copy successfully ('Copied successfully');
}
});
});


It is worth noting that if the copied content comes from input box input, textarea, etc., use the copy object:

copy: function(){
return $( '#mytext').val();
}


If the copied content comes from page elements div, p, etc., use the copy object:

copy: $('#mytext').text( );


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template