发布网友 发布时间:2022-04-25 14:18
共1个回答
热心网友 时间:2022-04-25 19:10
我单独测试没问题,但是我在具体项目中使用的时候,是在窗口弹出的时候在绑定的,那两个js文件都引用了。
if (r) {
$('#share').dialog('open').dialog('setTitle', '请选择新的目录');
document.getElementById("Extractcode").value = generateMixed(10);
document.getElementById("link").value = url;
$(document).ready(function () {
$("#dynamic").zclip({
path: '/Areas/AMS/Scripts/jquery_zclip/ZeroClipboard.swf',
copy: function () { return $('input#link').val(); },
beforeCopy: function () {
$('#dynamic').css('background', 'red');
$(this).css('color', 'orange');
},
afterCopy: function () {
$('#dynamic').css('background', 'black');
$(this).css('color', 'purple');
alert("copy成功");
}
});
});
窗口界面:
<form id="Secretform" method="post" novalidate>
<div data-options="region:'center',split:true" style="width: 380px">
<ul class="Archives_BasicInfo">
<li style="display: none">
<span class="Archives_BasicInfo_title">id:</span>
<span >
<input type="text" name="autoid" id="autoid" value=""/></span>
</li>
<li id="linkli">
<span class="Archives_BasicInfo_title">链接地址:</span>
<span >
<input type="text" name="copy" id="link" style="width: 200px"/></span>
</li>
<li id="date">
<span class="Archives_BasicInfo_title">有效时间:</span>
<span >
<input class="easyui-datetimebox" name="effectivedate" id="effectivedate" value=""/></span>
</li>
</ul>
</div>
<div data-options="region:'south',border:false" style="text-align: right; padding: 5px 0 0;">
<a href="javascript:void(0)" id="dynamic">复制</a>
<a class="easyui-linkbutton" id="linkbutton" data-options="iconCls:'icon-ok'" href="javascript:void(0)" onclick="SaveCode()">确定</a>
<a class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" href="javascript:void(0)" onclick="javascript:$('#share').dialog('close');">取消</a>
</div>
</form>