js代码如下:
<script type="text/javascript">
var NameObj;
function InitializeObject() {
function onStatusChange(name, status, id) {
tip = "../Images/lync/imnhdr" + status + ".gif";
document.getElementById(id).src = tip;
}
NameObj = new ActiveXObject('Name.NameCtrl.1');
NameObj.OnStatusChange = onStatusChange;
}
InitializeObject();
function ShowOOUI(id) {
NameObj.ShowOOUI(id.alt, 0, document.body.clientWidth / 2, document.body.clientHeight / 2);
}
function HideOOUI() {
NameObj.HideOOUI();
}
function GetState() {
var list = $(".imstate");
for (var i = 0; i <= list.length - 1; i++) {
list[i].id="imstate"+i;
NameObj.GetStatus(list[i].alt, list[i].id);
}
}
GetState();
</script>
msdn参考地址:http://msdn.microsoft.com/zh-cn/library/bb862067.aspx
好像PresenceEnabled设置为true的时候,当用户转台改变的后才能够掉用onStatusChange 这个方法的。希望看到的兄弟帮帮忙哦;谢谢了啦!