支持所有浏览器的点击复制
XML/HTML Code
- <div style='position:relative'><span id='copy_input'>点击复制</span>:<span id='mytext'>3333333333@sina.xxxx,3333333333@sina.xxx,3333333333@sina.com,sinaxxs.com@sina.com,sina.com@tes.com,sina.com@sina.com,waike@sinax.com,zerogo@sina22.com,waike@sina.com,</span></div>
- </div>
- <script>
- $('#copy_input').zclip({
- path: "ZeroClipboard.swf",
- copy: function(){
- return $('#mytext').text();
- },
- afterCopy: function(){//复制成功
- $("<span id='msg'/>").insertAfter($('#copy_input')).text('复制成功');
- }
- });
- </script>
原文地址:http://www.freejs.net/article_jquerywenzi_605.html