Zclip-jquery外掛程式支援全瀏覽器複製

來源:互聯網
上載者:User

標籤:style   blog   http   io   color   ar   java   sp   div   

1.Zclip-jquery外掛程式需要瀏覽器支援flash10及以上,現在的瀏覽器基本都支援

2.http://www.steamdev.com/zclip/下載相關組件:

query.zclip.min.js

ZeroClipboard.swf

去網上找個jquery架構:jquery.min.js

代碼實現:

<html><meta charset="UTF-8"> <style>a:active, a:hover { outline:0 }a { text-decoration:none; outline:0 }.clr { clear:both; height:0; }a.react { display:block; color:inherit; height:100%; text-decoration:none; }a.react:active, a.react.react-active { background:rgba(0, 0, 0, .1) }.fuzhi { width:60px; height:30px; line-height:30px; background:#fa870b; cursor:pointer; color:#fff; display:block; text-align:center; font-size:.75em; outline:0; float:left; }.fz2 { margin:0 auto; -webkit-border-radius:2px;-moz-border-radius:2px; border-radius:2px; }</style><script type="text/javascript" src="jquery.min.js"></script><script type="text/javascript" src="jquery.zclip.min.js"></script><script type="text/javascript">    $(function(){       $(‘#copy‘).zclip({             path: ‘ZeroClipboard.swf‘ ,            //copy: $(‘#qh‘).text(), //複製div,<span>,<p>等標籤的內容            copy: function(){                return $(‘#qh‘).val() //複製input,textarea等內容            },            afterCopy: function(){             $(‘#copy‘).html(‘複製成功‘)//複製成功,可以省略            }            });    });    </script><body><textarea style="width:250;height:200" id="qh">zClip is a lightweight jQuery "copy to clipboard" plugin built using the popular Zero Clipboard library. This plugin uses an invisible Adobe Flash movie that is fully compatible with Flash Player 10 and below.</textarea><br /><!--</span id ="qh">zClip is a lightweight jQuery "copy to clipboard" plugin built using the popular Zero Clipboard library. This plugin uses an invisible Adobe Flash movie that is fully compatible with Flash Player 10 and below. </span><br />--><a href="javascript:void(0);" class="fuzhi fz2" id="copy" >複&nbsp;制</a></body></html>

 

Zclip-jquery外掛程式支援全瀏覽器複製

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.