我试图在滚动元素时预览某些内容(以查看包含该元素的整体数据)并且当我推出时一切都恢复原状。问题是当我快速移动鼠标光标时,有时mouseout方法没有发生并且数据保持更新,我不希望那样。知道我该怎么做吗?
$(document).on("mouseover", ".checkRezolvata", function(e){
var idTemp = "";
idTemp = $(this).parent().parent().parent().attr("id");
data = {
id: idTemp,
set: 1 }
$.ajax({
type: "POST",
url: "crm/setRezolvataTemp.php",
data: data,
async: false,
success: function(data){
if(data == 1) {
getStats();
getTarget();
} else
alert("Eroare la schimbarea starii crmului temp!");
},error: function(){
alert("eroare");
}
});
});
$(document).on("mouseout", ".checkRezolvata", function(){
var idTemp = "";
idTemp = $(this).parent().parent().parent().attr("id");
data = {
id: idTemp,set: 0}
$.ajax({
type: "POST",
url: "crm/setRezolvataTemp.php",
data: data,
async: false,
success: function(data){
if(data == 1) {
getStats();
getTarget();
} else
alert("Eroare la schimbarea starii crmului temp!");
},error: function(){
alert("eroare");
}
});
});