DIV CSS 佈局教程網

 DIV+CSS佈局教程網 >> 網頁腳本 >> JavaScript入門知識 >> 關於JavaScript >> JS+flash實現chrome和ie浏覽器下同時可以復制粘貼
JS+flash實現chrome和ie浏覽器下同時可以復制粘貼
編輯:關於JavaScript     
利用2個文件

ZeroClipboard.js

ZeroClipboard.swf
復制代碼 代碼如下:
<script type="text/javascript" src="ZeroClipboard.js"></script>
<script language="JavaScript">

var clip = null;

function $(id) { return document.getElementById(id); }

function init(xm) {
clip = new ZeroClipboard.Client();
clip.setHandCursor( true );

clip.addEventListener('load', function (client) {
debugstr("Flash movie loaded and ready.");
});

clip.addEventListener('mouseOver', function (client) {
// update the text on mouse over
clip.setText($('txt_links').value );
});

clip.addEventListener('complete', function (client, text) {
debugstr(xm );
});

clip.glue( 'd_clip_button', 'd_clip_container' );
}

function debugstr(msg) {
if(msg=='1'){
alert('復制成功,請用Chrl+V粘貼');
//alert('chushihu,請用Chrl+V粘貼');
}else{

}

}
</script>

注意:<body onload="init(1);">
XML學習教程| jQuery入門知識| AJAX入門| Dreamweaver教程| Fireworks入門知識| SEO技巧| SEO優化集錦|
Copyright © DIV+CSS佈局教程網 All Rights Reserved