原始js:
/**
* 参与人输入框事件
**/
$("#boss").click(function(){
var divLocation = $(this).offset();
if (getOs()=="MSIE"){//判断IE
$("#joinPeople").css({left:divLocation.left, top:divLocation.top -70 +"px"});
}else{
$("#joinPeople").css({left:divLocation.left, top:divLocation.top - 81 +"px"});
}
$("#approverPeople").slideUp("fast");
$("#joinPeople").slideDown("fast");
return false;
});
修改后JS:
/**
* 参与人输入框事件
**/
$("#boss").click(function(){
var divLocation = $(this).offset();
var locationValue = 471-divLocation.top;//多加一个差值即可解决
if (getOs()=="MSIE"){//判断IE
$("#joinPeople").css({left:divLocation.left, top:divLocation.top -70 +locationValue +"px"});//别忘了此处也要加
}else{
$("#joinPeople").css({left:divLocation.left, top:divLocation.top - 81 +locationValue +"px"});//别忘了此处也要加
}
$("#approverPeople").slideUp("fast");
$("#joinPeople").slideDown("fast");
return false;
});