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

  1. zclip uses swf flash overlap or triggers clipboard copy. might not work file://, it'll work in local site.
  2. sometimes, zclip doesn't position overlap flash - correctly. need adjust position manually.

Comments

Popular posts from this blog

Change php variable from jquery value using ajax (same page) -

Pull out data related to my apps from Android Play Store and iOS App Store -

How can I fetch data from a web server in an android application? -