【发布时间】:2012-07-20 11:24:15
【问题描述】:
<script type="text/javascript">
jQuery(function() {
jQuery(".process").click(function() {
var enter = $(".enter").val();
out = parseFloat(enter) + Math.floor((Math.random()*10)+1);
$('.enter').attr("value", out);
$('.process').fadeOut(0);
$('.copy').fadeIn(0);
});
});
jQuery(function() {
jQuery(".copy").click(function() {
$(".copy").zclip({
path:'js/ZeroClipboard.swf',
copy:function() { return $(".enter").val(); },
afterCopy: afterCopy()
});
function afterCopy() {
$(".enter").val('');
$('.copy').fadeOut(0);
$('.process').fadeIn(0);
}
});
});
</script>
<form class="form-wrapper cf" action="">
<span>Enter A Number</span> <br />
<input type="text" class="enter" size="15" />
<button type="button" class="process">process</button>
<button type="button" class="copy" style="display:none;">copy</button>
</form>
jQuery zClip 插件在我的代码中不起作用。
我想将第一个函数 [ jQuery(".process").click(function() ] 生成的值作为循环复制几次。
jsFiddle:http://jsfiddle.net/npYBm/
插件页面:http://www.steamdev.com/zclip/
有什么解决办法吗?谢谢。
问题已解决
【问题讨论】:
-
问题已解决 - 如何?
标签: javascript jquery plugins zclip