function postmessage(){
var delayTime = [];
$.each(arr,function(key,val){
//回调函数有两个参数,第一个是元素索引,第二个为当前值
delayTime[key] = setTimeout(function() {
$("#postform").attr("action",val);
$("#postform").attr("target","_blank");
$("#postform").submit();
},2000)
//if (key > 28) return false;
//$.post(val, $("#postform").serialize());
});
}遍历数组,数组是n个url地址,然后向这些url提交表单同时提交的太多了,很卡想做个延时,怎么写啊?
var delayTime = [];
$.each(arr,function(key,val){
//回调函数有两个参数,第一个是元素索引,第二个为当前值
delayTime[key] = setTimeout(function() {
$("#postform").attr("action",val);
$("#postform").attr("target","_blank");
$("#postform").submit();
},2000)
//if (key > 28) return false;
//$.post(val, $("#postform").serialize());
});
}遍历数组,数组是n个url地址,然后向这些url提交表单同时提交的太多了,很卡想做个延时,怎么写啊?
<html>
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script>
function show(){
alert("show!!");
}$(function(){
$('#mydiv').mouseover(function(){
t = setTimeout("show()",2000);
}).mouseout(function(){
clearTimeout(t);
});
});
</script>
</head><body>
<span id="mydiv">我是菜单</span>
</body>