var clip=null;
clip = new ZeroClipboard.Client();//new 一个对像
clip.setText(null);
ZeroClipboard.setMoviePath( '${pageContext.request.contextPath}/media/js/ZeroClipboard.swf'); //和html不在同一目录需设置setmoviepath
//ZeroClipboard.setMoviePath( '../media/js/zeroclipboard10.swf');
clip.setHandCursor(true);
clip.addEventListener('mousedown', function(client) {
window.passwd = document.getElementById("file-password").value;
clip.setText(window.passwd);
});
clip.addEventListener('complete', function (client, text) {
window.url = document.getElementById("file-url").value;
var id=get_param("id");
var type=get_param("type");
window.open(window.url,'_self');
$('.theme-popover').hide();
$('.theme-popover-mask').hide();//将复制框dismiss
document.getElementById("theme-popover").style.visibility="hidden";//影藏
//记录下载信息
$.ajax({
type: "post",
url: "${pageContext.request.contextPath}/download/statistic.action",
dataType:"json",
data:{
id:id,
type:type
},
success:function(data){;}
});
});
clip.glue('copy-password','copy-dialog');代码中的记录下载信息等都是和去转盘网有关系,你不必关心,下面一句:document.getElementById("theme-popover").style.visibility="hidden";//影藏非常重要,因为要悬浮层复制,如果是相对布局flash是找不见覆盖按钮的,所以开始的时候ThinkPHP 是一个免费开源的,快速、简单的面向对象的 轻量级PHP开发框架 ,创立于2006年初,遵循Apache2开源协议发布,是为了敏捷WEB应用开发和简化企业应用开发而诞生的。ThinkPHP从诞生以来一直秉承简洁实用的设计原则,在保持出色的性能和至简的代码的同时,也注重易用性。并且拥有众多的原创功能和特性,在社区团队的积极参与下,在易用性、扩展性和性能方面不断优化和改进,已经成长为国内最领先和最具影响力的WEB应用开发框架,众多的典型案例确保可以稳定用于商业以及门户级的开发。