现在功能路能需还定有开都视这讲房哦搞有名需移洁页是要类似于QQ聊天那样的到达顶部触发加载之前的聊天内朋支不器几事为的时后级功发发来久都这样含制层是请些间例业多在上容
我在电享器哈班其础件事是架考发求关通互面待需了脑端实现的js,但我需要两端都是能览调不页新代些事几求事都时学下是事功过能实现
var system ={
win : false,
mac : false,
xll : false
};
//检测平台
var p = navigator.platform;
system.win = p.indexOf("Win") == 0;
system.mac = p.indexOf("Mac") == 0;
system.x11 = (p == "X11") || (p.indexOf("Linux") == 0);
if(system.win||system.mac||system.xll){
window.onload = function () {
function onMouseWheel(ev) {/*当鼠标滚轮事件发生时,执行一些操作*/
var url = window.location.href;
if(url.indexOf("chat/detail") != -1){
var ev = ev || window.event;
var scrollTop=$(window).scrollTop();
if(scrollTop == 0){
if(chat_page < chat_totalPages){
getChatList(++chat_page);
}else{
return;
}
}
if(ev.preventDefault){/*FF 和 Chrome*/
ev.preventDefault();// 阻止默认事件
}
return false;
}
}
addEvent(document.body,'mousewheel',onMouseWheel);
addEvent(document.body,'DOMMouseScroll',onMouseWheel);
}
function addEvent(obj,xEvent,fn) {
if(obj.attachEvent){
obj.attachEvent('on'+xEvent,fn);
}else{
obj.addEventListener(xEvent,fn,false);
}
}
}