ssrsblogs

一:引包

  

<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="ZeroClipboard.js"></script>

 

二:js代码

  

function copyContent(){
    //content 为要复制的内容的标识
    $(\'.content\').click(function(){
        $(this).select();
    });
 
    //设置swf路径
    ZeroClipboard.setMoviePath("ZeroClipboard.swf"); 
    //创建对象
    var clip = new ZeroClipboard.Client();
    //设置手型
    clip.setHandCursor(true); 
    //绑定按钮
    clip.glue(\'copy_btn\');
    //复制内容
    clip.addEventListener( "mouseOver", function(client) {
        client.setText($(\'#content\').text());
    });
    //复制成功后的提示
    clip.addEventListener( "complete", function(){    
        alert("copyed successful");     
    }); 
}

需要引入    ZeroClipboard.swf。

所需文件下载地址:http://download.csdn.net/detail/changjn/8462271

posted on 2015-02-28 10:36  sherryChang  阅读(543)  评论(0编辑  收藏  举报

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-03
  • 2021-12-03
  • 2021-09-01
  • 2021-09-28
  • 2021-12-19
  • 2021-12-03
猜你喜欢
  • 2021-12-13
  • 2021-12-13
  • 2021-12-10
  • 2021-12-03
  • 2022-12-23
  • 2021-12-29
  • 2022-12-23
相关资源
相似解决方案