当前位置: 软件>JavaScript软件
Steady.js
本文导语: Steady.js 可实现无闪烁的 onscroll 事件处理,而不会有性能方面的损失。 基本使用方法: Hello world! var s = new Steady({ conditions: { "width": 400px, "scrollX": 0, ...
Steady.js 可实现无闪烁的 onscroll 事件处理,而不会有性能方面的损失。
基本使用方法:
Hello world!
var s = new Steady({
conditions: {
"width": 400px,
"scrollX": 0,
"max-bottom": 200px
},
throttle: 100,
handler: fn
});
// you cann conditions on the fly!
s.addCondition('scrollX', 0);
function fn(values, done) {
var xhr = new XMLHttpRequest();
xhr.open('GET', 'imgs.html');
xhr.onreadystatechange = function() {
if ( xhr.readyState == 4 ) {
document.body.innerHTML += xhr.response;
// telling Steady that we're done processing!
done();
}
};
xhr.send();
}
您可能感兴趣的文章:
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。