-----------------------For dynamic label binding events--------------------- ---
var outTimer;//Execution time
var upTimer;//Execution time
var sqDiv = $("#tm");//The div to be displayed
var test="";//Identification, in order to move the mouse to the displayed div
var dd = "";//Scratch the value passed by a certain field
function test1(){
$("#tm").empty();// Now clear the div
$.ajax({ //Add data in it
type: "post",
url: "<%=path %>/webmodule/constructionDecision/BaseCD/getCommunityInfo.do ?stCode=" dd,
dataType:"json",
async:false,
success:function(data){
var td="";
for(var i=0 ;i
td ="" data[i].name "";
}
$("#tm").append(td);
}
});
$("#tm").show();
}
function test2(){//How to hide div
if(test ==""){
$("#tm").hide();
}
}
$("#cityTable a").die().live('mouseover mouseout', function(event) { //Bind events to dynamic tags
if(event.type=='mouseover '){ //When moving up
clearTimeout(outTimer);//Clear the time out first, so as to avoid executing functions when the mouse is moved over and reduce the pressure on the server
dd=$(this).attr( "id");
upTimer = setTimeout(test1, 500);//Execute after 0.5 seconds
}
if(event.type=='mouseout'){
sqDiv.hover(
function(){
test = "on";//Indicates that the mouse is on the displayed div
}, function(){
test = "";
test2();
});
clearTimeout(upTimer);
outTimer = setTimeout(test2, 500);
}
});
------ -----------------------Non-dynamic tags (query information)--------------------- ----------------