var floatInfo = new Array();//房源浮窗信息
var mystr = "";//房源浮窗属html
functionFloatInfoById(houseId, e) {
mystr= "";if (floatInfo[houseId] == "" || floatInfo[houseId] ==undefined) {
mystr=ajaxFloatInfo(houseId);
}else{
mystr=JS_FloatInfo(houseId);
}
$("#flckdiv").html(mystr);
showFloat(e, mystr);
}functionajaxFloatInfo(houseId) {
$.ajax({
url:'/House/HouseInfo/GetInfoById',
type:"post",
cache:false,
async:false, //同步方式发起请求
data: { Id: houseId },
success:function(ds) {if (ds[1].length <= 0 || ds[0].length <= 0) {
mystr+= "
}else{
mystr+= "
mystr+= "
跟单:" + ds[0][0].clientPerInfo + " " + ds[0][0].clientTime + "";mystr+= "
店长:" + ds[0][0].clientPerInfo2 + " ";mystr+= "
";if (ds[1].length > 0) {mystr+= "
精耕内容 精耕时间 ";mystr+= "
";for (var i = 0; i < ds[1].length; i++) {if (ds[1][i].remark.length > 90) {ds[1][i].remark = ds[1][i].remark.substring(0, 89) + "..."}
mystr+= "
" + ds[1][i].remark + " " + ds[1][i].addtime + "";}
}
mystr+= "
";}
}
});if (floatInfo.indexOf(mystr) < 0) {
floatInfo[houseId]=mystr;
}returnmystr;
}//JS缓存
functionJS_FloatInfo(houseId) {
mystr=floatInfo[houseId];returnmystr;
}//显示浮窗
functionshowFloat(e, mystr) {var pX = 150; var pY = 60;if (mystr == "
pX= 50; pY = 60;
}
$("span[name='houseView']").mousemove(function(e) {
$('#flckdiv').eq($(this).index()).show().css({"top": e.pageY -pX,"left": e.pageX +pY
})
}).mouseleave(function(e) {
$('#flckdiv').hide();
});
}//房源浮窗
$(function() {
$("#tb_commlist").on("mouseover", "span[name='houseView']", function(e) {var houseId = $(this).attr('data-id');
FloatInfoById(houseId, e)
});
})