jquery - How to initialize zClip on click of a button -
for zclip instead of initializing follows:
$(document).ready(function(){ is possible initialize on click of button? if yes how can done.
include zlicp js
<script type="text/javascript" src="http://code.jquery.com/jquery-1.10.1.min.js"></script> <script type="text/javascript" src="jquery.zclip.min.js"></script> html markup:
<textarea id="text-to-copy"></textarea> <button id="copy-button">copy</button> <script> $(function () { $('#copy-button').zclip({ path: 'zeroclipboard.swf', copy: function() { return $('#text-to-copy').val(); } }); }); </script> two things need aware of
- zclip uses swf flash overlap or triggers clipboard copy. might not work file://, it'll work in local site.
- sometimes, zclip doesn't position overlap flash - correctly. need adjust position manually.
Comments
Post a Comment