0
我在我的网站上有一个聊天功能,我希望在标题标签中闪烁显示“来自John的新消息”的Facebook功能,当有新消息进来时我可以这样做新消息的一个实例,但是我需要为所有新消息执行此操作(无限可能)。因此需要创建一个setInterval循环,并循环发送新消息的人员的姓名。假设约翰,苏,乔治和凯蒂给我发了新消息;这是我到目前为止有:jquery闪烁标题标签中的数组值
$("div .labels").each(function(){ //.labels where each persons name is displayed in the bottom banner bar
var senderFirstName = $(this).attr('rel');
//this is where I need to create the array "AllNames" containing all of the sender names
});
现在我有阵“AllNames”包含的人向我发送消息的所有名字,我通过这个阵列需要周期每1500毫秒,并更改标题标签反映新的名字。
var BlinkTitle = setInterval(function(){
$("title").text("message from " + AllNames[0]); //AllNames array needs to cycle through the array values every time the interval loops.
},1500);
请帮助!