Comments (9)
在 onchange 方法里面可以知道 this.index 当前页面的索引,那么,this.index+1 就是下一页,this.index-1 就是上一页
from pageslider.
那在onbeforechange方法里面能知道即将滑动到的下一页的index吗?我希望能在滑动到某一页之前把某些元素给隐藏掉
from pageslider.
你的某一页肯定是固定的某一页对不对,那么,你可以在 onSwipeUp 和 onSwipeDown 方法里面判断:
假设某一页是 3
new PageSlider({
pages: $('.page-wrap .page'),
onSwipeUp: function(){
if(this.index+1 === 3){
//ooxx.style.display = 'none';
}
},
onSwipeDown: function(){
if(this.index-1 === 3){
//ooxx.style.display = 'none';
}
}
});
from pageslider.
赞,非常感谢,请接受小白的膝盖
from pageslider.
还有个问题,如果这页内容很长的话,岂不是还没滑动到下一页,在向上滑动的时候就把某些元素给隐藏了?
from pageslider.
所以有一个长页面的需求
from pageslider.
"我希望能在滑动到某一页之前把某些元素给隐藏掉'",你给的建议是:
onSwipeUp: function(){
if(this.index+1 === 3){
//ooxx.style.display = 'none';
}
如果当前在index = 2的页面上,并且该页面是个长页面的话,岂不是向上滑动的时候,某些元素就隐藏了,如果我希望在跳转到另一页的时候才隐藏,在长页面向上滑动的时候不希望隐藏它,该怎么办呢?
from pageslider.
你再加一个判断不就行了?如果当前页是长页面,就不隐藏
from pageslider.
没太明白,那如何区分滑动的时候是当前页滑动还是跳到下一页的滑动呢?
from pageslider.
Related Issues (17)
- 太赞了,加油! HOT 3
- 如果页面内要放刮刮卡,有什么办法阻止页面滑动吗 HOT 2
- 调用moveto(n)之后向下滑动失效 HOT 2
- 在ios手机上加某些动画,背景图片会闪烁一下 HOT 2
- 华为手机虚拟键盘会引发滑页BUG HOT 3
- 关于预加载的问题 HOT 1
- 嵌入到 iframe后,longpage不能滚动
- translate导致fixed失效,有解决办法吗?
- 请问能够禁止上下滚动吗 HOT 1
- moveTo 跳转不了指定的index页面 HOT 6
- 为何“-webkit-overflow-scrolling: touch;”有时不起作用 HOT 1
- 关于长页面的高度问题 HOT 3
- 从Android app里面内嵌的浏览器打开为何滚动不了而且翻不了页,是兼容问题吗?ios可以的 HOT 6
- 你好,感谢你开发此插件,example二维码不能用了 HOT 3
- 我加入了以下CSS后就不能正常使用了,我想让.mevos-con下面的图片宽、高都为100%铺满。 HOT 2
- page子元素的尺寸问题 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pageslider.