```
var a_idx = 0;
jQuery(document).ready(function($) {
$("body").click(function(e) {
var a = new Array("商品全部人工精心挑选","领券购买更实惠","下单绑定成功还有返利","返利余额1元即可提现","新人下单还有23元奖励","邀请好友还有奖励哦,最高奖励500元","买的越多越省钱哦","有任何问题都可以联系客服咨询");
var $i = $("").text(a[a_idx]);
a_idx = (a_idx + 1) % a.length;
var x = e.pageX,
y = e.pageY;
$i.css({
"z-index": 99999 ,
"top": y - 20,
"left": x,
"position": "absolute",
"font-weight": "bold",
"color": "#ff6651"
});
$("body").append($i);
$i.animate({
"top": y - 180,
"opacity": 0
},
1500,
function() {
$i.remove();
});
});
});
function copyNum(i)
{
var NumClip=document.getElementById("tnum"+i);//编辑框指向
var NValue=NumClip.value;//编辑框的内容
var valueLength = NValue.length;//内容长度
selectText(NumClip, 0, valueLength);//取得指定长度的内容
if(document.execCommand('copy', false, null))//复制内容
{
var text ="红包口令:"+ NValue+"\n复制成功!请返回公众号发送给我领取红包哦~";
alert(text);
}else{
alert("复制失败");
}
}
function selectText(textbox, startIndex, stopIndex)
{
if(textbox.createTextRange) {
var range = textbox.createTextRange();
range.collapse(true);
range.moveStart('character', startIndex);
range.moveEnd('character', stopIndex - startIndex);
range.select();
}else{
textbox.setSelectionRange(startIndex, stopIndex);
textbox.focus();
}
}
```