binnng / slip.js Goto Github PK
View Code? Open in Web Editor NEW移动端跟随手指滑动组件,零依赖。
Home Page: http://binnng.github.io/slip.js
移动端跟随手指滑动组件,零依赖。
Home Page: http://binnng.github.io/slip.js
由于现在的库一加载完就获取window.innerHeight 导致了获取一个1400+的值。
问题详见:http://cure.sinaapp.com/
现在我的解决办法是延迟如下,望修改
setTimeout(function() {
var slipJS = document.createElement("script");
slipJS.src = "/statics/scripts/min.slip.js";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(slipJS, s);
slipJS.onload = slipJS.onreadystatechange = function() {
var slip = Slip(wrap, 'y')
.webapp()
.start(function() {
arrowUpElement.style.display = 'none';
})
.end(function() {
arrowUpElement.style.display = 'block';
});
}
}, 500);
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script src="../assets/libs/min.slip.js"></script>
</head>
<body>
<div id="container">
<div>aDD</div>
<p id="cc">b</p>
<div>c</div>
</div>
<script>
var a = document.getElementById('container');
var slip = Slip(a, "x");
slip.webapp();
slip.jump("#cc");
</script>
</body>
</html>
RT.
在android 4.4系统的微信浏览器打开会出现多余一屏空白的页面,可以正常滚动不知为啥
我看了下master分支中的jump方法,觉得不是很好,对比了ghpage里面的jump,他们是不一样的。
var ele = document.getElementById("container");
Slip(ele, "x").slider();
我这样子设置后还是为垂直方向上滑动,水平方向上没有任何反应。
这个需求还挺常见的
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.